diff --git a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt index ff995311e6..51a217c526 100644 --- a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt @@ -185,7 +185,7 @@ class NewHomeDetailFragment : } newHomeDetailViewModel.onEach { viewState -> - refreshUnreadCounterBadge(viewState.spacesNotificationCount) + refreshUnreadCounterBadge(viewState.spacesNotificationCount, viewState.hasPendingSpaceInvites) } } @@ -386,11 +386,21 @@ class NewHomeDetailFragment : } } - private fun refreshUnreadCounterBadge(roomAggregateNotificationCount: RoomAggregateNotificationCount) { - val badgeState = UnreadCounterBadgeView.State.Count( - count = roomAggregateNotificationCount.notificationCount, - highlighted = roomAggregateNotificationCount.isHighlight, - ) + private fun refreshUnreadCounterBadge( + spacesNotificationCount: RoomAggregateNotificationCount, + hasPendingSpaceInvites: Boolean, + ) { + val badgeState = if (hasPendingSpaceInvites && spacesNotificationCount.notificationCount == 0) { + UnreadCounterBadgeView.State.Text( + text = "!", + highlighted = true, + ) + } else { + UnreadCounterBadgeView.State.Count( + count = spacesNotificationCount.notificationCount, + highlighted = spacesNotificationCount.isHighlight, + ) + } views.spacesUnreadCounterBadge.render(badgeState) } diff --git a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailViewState.kt b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailViewState.kt index 20ad9be4b4..1ff0b86511 100644 --- a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailViewState.kt +++ b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailViewState.kt @@ -21,4 +21,5 @@ import org.matrix.android.sdk.api.session.room.summary.RoomAggregateNotification data class NewHomeDetailViewState( val spacesNotificationCount: RoomAggregateNotificationCount = RoomAggregateNotificationCount(notificationCount = 0, highlightCount = 0), + val hasPendingSpaceInvites: Boolean = false, ) : MavericksState