Skip to content

Commit

Permalink
web/roomlist: fix unread counter overflow condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 2, 2025
1 parent 3c3e245 commit d8f0a82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/ui/roomlist/UnreadCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit d8f0a82

Please sign in to comment.