diff --git a/web/src/ui/roomlist/Entry.tsx b/web/src/ui/roomlist/Entry.tsx index 69b8459..c9f211e 100644 --- a/web/src/ui/roomlist/Entry.tsx +++ b/web/src/ui/roomlist/Entry.tsx @@ -55,6 +55,15 @@ interface InnerProps { const EntryInner = ({ room }: InnerProps) => { const [previewText, croppedPreviewText] = usePreviewText(room.preview_event, room.preview_sender) + const unreadCount = room.unread_messages || room.unread_notifications || room.unread_highlights + const countIsBig = Boolean(room.unread_notifications || room.unread_highlights) + let unreadCountDisplay = unreadCount.toString() + if (unreadCount > 999 && countIsBig) { + unreadCountDisplay = "99+" + } else if (unreadCount > 9999 && countIsBig) { + unreadCountDisplay = "999+" + } + return <>