diff --git a/app/javascript/flavours/glitch/features/notifications/components/filtered_notifications_banner.jsx b/app/javascript/flavours/glitch/features/notifications/components/filtered_notifications_banner.jsx index 4239d3d3e5..a2149ce89e 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/filtered_notifications_banner.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/filtered_notifications_banner.jsx @@ -27,7 +27,7 @@ export const FilteredNotificationsBanner = () => { }; }, [dispatch]); - if (policy === null || policy.getIn(['summary', 'pending_notifications_count']) * 1 === 0) { + if (policy === null || policy.getIn(['summary', 'pending_notifications_count']) === 0) { return null; } diff --git a/app/javascript/flavours/glitch/utils/numbers.ts b/app/javascript/flavours/glitch/utils/numbers.ts index 03235cea81..89526404b3 100644 --- a/app/javascript/flavours/glitch/utils/numbers.ts +++ b/app/javascript/flavours/glitch/utils/numbers.ts @@ -70,10 +70,10 @@ export function roundTo10(num: number): number { return Math.round(num * 0.1) / 0.1; } -export function toCappedNumber(num: string): string { - if (parseInt(num) > 99) { - return '99+'; +export function toCappedNumber(num: number, max = 99): string { + if (num > max) { + return `${max}+`; } else { - return num; + return num.toString(); } }