1
0
Fork 0
forked from Mirrors/gomuks

web/roomlist: fix unread counter overflow condition

This commit is contained in:
Tulir Asokan 2025-01-02 11:17:22 +02:00
parent 3c3e2456e2
commit d8f0a82ffc

View file

@ -38,9 +38,9 @@ const UnreadCount = ({ counts, space, onClick }: UnreadCountProps) => {
const countIsBig = !space const countIsBig = !space
&& Boolean(counts.unread_notifications || counts.unread_highlights || counts.marked_unread) && Boolean(counts.unread_notifications || counts.unread_highlights || counts.marked_unread)
let unreadCountDisplay = unreadCount.toString() let unreadCountDisplay = unreadCount.toString()
if (unreadCount > 999 && countIsBig) { if (unreadCount > 999 && (countIsBig || space)) {
unreadCountDisplay = "99+" unreadCountDisplay = "99+"
} else if (unreadCount > 9999 && countIsBig) { } else if (unreadCount > 9999) {
unreadCountDisplay = "999+" unreadCountDisplay = "999+"
} }
const classNames = ["unread-count"] const classNames = ["unread-count"]