Fix unread indicator for messages (#7841)

* The expected logic for unread messages is displaying just a dot

The count might not be accurate, so we keep the dot for now.

* Fix tests
This commit is contained in:
Jorge Martin Espinosa
2026-10-02 16:36:22 +02:00
committed by GitHub
parent d826a72d49
commit 7fd8e5b721
2 changed files with 7 additions and 10 deletions
@@ -391,14 +391,11 @@ internal fun RoomListRoomSummary.unreadIndicatorCount(
val isMuted = userDefinedNotificationMode == RoomNotificationMode.MUTE
return when {
// Show only unread notifications when the room is not muted and there are unread notifications
!isMuted && numberOfUnreadNotifications > 0 -> numberOfUnreadNotifications
// Otherwise, show unread messages when showAllActivity is true
showAllActivity -> numberOfUnreadMessages.takeIf { it > 0 }
!isMuted && numberOfUnreadNotifications > 0 -> if (showUnreadCount) numberOfUnreadNotifications else 0
// Otherwise, show a dot for unread messages when showAllActivity is true and there are unread messages
showAllActivity -> if (numberOfUnreadMessages > 0) 0 else null
// Or don't display anything
else -> null
}?.let {
// We only want to show the count if the option is enabled, otherwise we just show the dot indicator (value 0)
if (showUnreadCount) it else 0
}
}