From 0b9f1a494a2323e12ddbed10b06cca82ffe12306 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 21 Oct 2022 13:39:47 +1100 Subject: [PATCH] fix: allow 99 unread count before going to 99+ --- ts/components/icon/SessionNotificationCount.tsx | 6 +++--- ts/components/leftpane/ActionsPanel.tsx | 2 -- ts/state/selectors/conversations.ts | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ts/components/icon/SessionNotificationCount.tsx b/ts/components/icon/SessionNotificationCount.tsx index b4102bf23..99da0b924 100644 --- a/ts/components/icon/SessionNotificationCount.tsx +++ b/ts/components/icon/SessionNotificationCount.tsx @@ -27,19 +27,19 @@ const StyledCountContainer = styled.div<{ shouldRender: boolean }>` const StyledCount = styled.div` position: relative; - font-size: 0.6em; + font-size: 0.6rem; `; export const SessionNotificationCount = (props: Props) => { const { count } = props; - const overflow = Boolean(count && count > 9); + const overflow = Boolean(count && count > 99); const shouldRender = Boolean(count && count > 0); if (overflow) { return ( - {9} + {99} + diff --git a/ts/components/leftpane/ActionsPanel.tsx b/ts/components/leftpane/ActionsPanel.tsx index 12f0ed8b4..e71510f3a 100644 --- a/ts/components/leftpane/ActionsPanel.tsx +++ b/ts/components/leftpane/ActionsPanel.tsx @@ -117,7 +117,6 @@ const Section = (props: { type: SectionType }) => { iconSize="medium" dataTestId="settings-section" iconType={'gear'} - notificationCount={unreadToShow} onClick={handleClick} isSelected={isSelected} /> @@ -138,7 +137,6 @@ const Section = (props: { type: SectionType }) => { iconSize="medium" iconType={isDarkMode ? 'moon' : 'sun'} dataTestId="theme-section" - notificationCount={unreadToShow} onClick={handleClick} isSelected={isSelected} /> diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 62510df09..563db45f8 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -364,7 +364,7 @@ export const _getLeftPaneLists = ( } if ( - unreadCount < 9 && + unreadCount < 100 && conversation.unreadCount && conversation.unreadCount > 0 && conversation.currentNotificationSetting !== 'disabled'