From 89d05ac952a825ae578e28043f4be3c0732168fd Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 10 Sep 2020 13:51:34 +0100 Subject: [PATCH 1/2] bring back 1.2M style badge counts rather than 99+ --- src/components/views/rooms/NotificationBadge.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/NotificationBadge.tsx b/src/components/views/rooms/NotificationBadge.tsx index 2957b25779..8b996d3238 100644 --- a/src/components/views/rooms/NotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; -import { formatMinimalBadgeCount } from "../../../utils/FormattingUtils"; +import { formatCount } from "../../../utils/FormattingUtils"; import SettingsStore from "../../../settings/SettingsStore"; import AccessibleButton from "../elements/AccessibleButton"; import { XOR } from "../../../@types/common"; @@ -109,7 +109,7 @@ export default class NotificationBadge extends React.PureComponent Date: Thu, 10 Sep 2020 13:56:46 +0100 Subject: [PATCH 2/2] kill formatMinimalBadgeCount entirely --- src/utils/FormattingUtils.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/utils/FormattingUtils.ts b/src/utils/FormattingUtils.ts index 52f8bfcfa2..1fe3669f26 100644 --- a/src/utils/FormattingUtils.ts +++ b/src/utils/FormattingUtils.ts @@ -119,14 +119,3 @@ export function formatCommaSeparatedList(items: string[], itemLimit?: number): s return _t("%(items)s and %(lastItem)s", { items: items.join(', '), lastItem: lastItem }); } } - -/** - * Formats a number into a 'minimal' badge count (9, 98, 99+). - * @param count The number to convert - * @returns The badge count, stringified. - */ -export function formatMinimalBadgeCount(count: number): string { - // we specifically go from "98" to "99+" - if (count < 99) return count.toString(); - return "99+"; -}