fix(chat-badge): don't count unread messages when restarting
Fixes #8943
This commit is contained in:
parent
4a5c439160
commit
297280c467
|
@ -137,7 +137,7 @@ proc buildChatSectionUI(
|
|||
continue
|
||||
|
||||
let hasNotification = not chatDto.muted and (chatDto.unviewedMessagesCount > 0 or chatDto.unviewedMentionsCount > 0)
|
||||
let notificationsCount = if (chatDto.muted): 0 else: chatDto.unviewedMentionsCount
|
||||
let notificationsCount = chatDto.unviewedMentionsCount
|
||||
|
||||
var chatName = chatDto.name
|
||||
var chatImage = ""
|
||||
|
|
|
@ -325,6 +325,7 @@ proc getNumOfNotificaitonsForChat*(self: Controller): tuple[unviewed:int, mentio
|
|||
if(chat.chatType == ChatType.CommunityChat):
|
||||
continue
|
||||
|
||||
if not chat.muted:
|
||||
result.unviewed += chat.unviewedMessagesCount
|
||||
result.mentions += chat.unviewedMentionsCount
|
||||
|
||||
|
@ -336,6 +337,7 @@ proc getNumOfNotificationsForCommunity*(self: Controller, communityId: string):
|
|||
if(chat.communityId != communityId):
|
||||
continue
|
||||
|
||||
if not chat.muted:
|
||||
result.unviewed += chat.unviewedMessagesCount
|
||||
result.mentions += chat.unviewedMentionsCount
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ proc createChannelGroupItem[T](self: Module[T], c: ChannelGroupDto): SectionItem
|
|||
mentionsCount = mentionsCount + receivedContactRequests.len
|
||||
|
||||
let hasNotification = unviewedCount > 0 or mentionsCount > 0
|
||||
let notificationsCount = mentionsCount # we need to add here number of requests
|
||||
let notificationsCount = mentionsCount
|
||||
let active = self.getActiveSectionId() == c.id # We must pass on if the current item section is currently active to keep that property as it is
|
||||
result = initItem(
|
||||
c.id,
|
||||
|
|
Loading…
Reference in New Issue