mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 14:54:48 +00:00
fix: fix mention not being removed
This commit is contained in:
parent
6eee5da36e
commit
5327b7feea
@ -217,19 +217,23 @@ QtObject:
|
||||
if (selectedChannel == nil): return
|
||||
discard self.status.chat.markAllChannelMessagesRead(selectedChannel.id)
|
||||
|
||||
proc clearUnreadIfNeeded*(self: ChatsView, channel: var Chat) =
|
||||
if (not channel.isNil and (channel.unviewedMessagesCount > 0 or channel.hasMentions)):
|
||||
var response = self.status.chat.markAllChannelMessagesRead(channel.id)
|
||||
if not response.hasKey("error"):
|
||||
self.chats.clearUnreadMessagesCount(channel)
|
||||
|
||||
proc setActiveChannelByIndex*(self: ChatsView, index: int) {.slot.} =
|
||||
if((self.activeCommunity.active and self.activeCommunity.chats.chats.len == 0) or (not self.activeCommunity.active and self.chats.chats.len == 0)): return
|
||||
|
||||
let selectedChannel =
|
||||
var selectedChannel =
|
||||
if (self.activeCommunity.active):
|
||||
self.activeCommunity.chats.getChannel(index)
|
||||
else:
|
||||
self.chats.getChannel(index)
|
||||
|
||||
if(not self.activeChannel.chatItem.isNil and self.activeChannel.chatItem.unviewedMessagesCount > 0):
|
||||
var response = self.status.chat.markAllChannelMessagesRead(self.activeChannel.id)
|
||||
if not response.hasKey("error"):
|
||||
self.chats.clearUnreadMessagesCount(self.activeChannel.chatItem)
|
||||
self.clearUnreadIfNeeded(self.activeChannel.chatItem)
|
||||
self.clearUnreadIfNeeded(selectedChannel)
|
||||
|
||||
if self.activeChannel.id == selectedChannel.id: return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user