forked from Mirrors/gomuks
web/roomlist: fix unread counter overflow condition
This commit is contained in:
parent
3c3e2456e2
commit
d8f0a82ffc
1 changed files with 2 additions and 2 deletions
|
@ -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"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue