mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
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:
committed by
GitHub
parent
d826a72d49
commit
7fd8e5b721
+3
-6
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user