Changes thread notifications saved to entity from sum to size

This commit is contained in:
ericdecanini 2022-10-07 11:45:58 -04:00
parent ebd8461724
commit c2ae75d9bd

View file

@ -114,12 +114,12 @@ internal class RoomSummaryUpdater @Inject constructor(
roomSummaryEntity.notificationCount = unreadNotifications?.notificationCount ?: 0
roomSummaryEntity.threadHighlightCount = unreadThreadNotifications
?.mapNotNull { it.value.highlightCount }
?.sum()
?.map { it.value.highlightCount.takeIf { count -> (count ?: 0) > 0 } }
?.size
?: 0
roomSummaryEntity.threadNotificationCount = unreadThreadNotifications
?.mapNotNull { it.value.notificationCount }
?.sum()
?.map { it.value.notificationCount.takeIf { count -> (count ?: 0) > 0 } }
?.size
?: 0