From d8f0a82ffc79b9c1706da5c68f33526ebe8d4706 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 2 Jan 2025 11:17:22 +0200 Subject: [PATCH] web/roomlist: fix unread counter overflow condition --- web/src/ui/roomlist/UnreadCount.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/ui/roomlist/UnreadCount.tsx b/web/src/ui/roomlist/UnreadCount.tsx index b1fb141..4ad48f5 100644 --- a/web/src/ui/roomlist/UnreadCount.tsx +++ b/web/src/ui/roomlist/UnreadCount.tsx @@ -38,9 +38,9 @@ const UnreadCount = ({ counts, space, onClick }: UnreadCountProps) => { const countIsBig = !space && Boolean(counts.unread_notifications || counts.unread_highlights || counts.marked_unread) let unreadCountDisplay = unreadCount.toString() - if (unreadCount > 999 && countIsBig) { + if (unreadCount > 999 && (countIsBig || space)) { unreadCountDisplay = "99+" - } else if (unreadCount > 9999 && countIsBig) { + } else if (unreadCount > 9999) { unreadCountDisplay = "999+" } const classNames = ["unread-count"]