Repository navigation
fix(chat): count unread groups in the Chats tab badge - #1557
Merged
Merged
Conversation
The Chats list shows tip DMs and groups, but the tab badge counted unread tip DMs only. When the only unread chats were groups, their rows showed a count and the tab showed no badge. Both now read through one definition in :shared:chat (chatListFeed, currentChatListFeed, observeUnreadChatListCount), so the badge counts the same chats as the list. SessionState.tipsUnreadCount is renamed to chatListUnreadCount, and the nav bar's tipUnreadCount to match; the Chats tab badge is their only reader.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Chats list shows tip DMs and groups, but the tab badge counted unread tip DMs only. When the only unread chats were groups, their rows showed a count and the tab had no badge.
ChatsViewModelreadfeed(TIP_DM, GROUP);RealSessionControllerreadobserveUnreadConversations(TIP_DM).chatListFeed()/currentChatListFeed()/observeUnreadChatListCount()in:shared:chat(ChatList.kt), which hold the one list of types.MuteChatViewModelused the same pair and moves over too.SessionState.tipsUnreadCount→chatListUnreadCount, andNavigationBarState.tipUnreadCountto match. The Chats tab badge was their only reader, so nothing else starts counting groups.ChatListUnreadCountTestruns the realFeedSyncDelegate: an unread group counts toward the badge, an unread contact DM doesn't.Same fix as iOS in code-payments/code-ios-app#860, where
chatListConversationsdrives both the list andunreadChatListCount.