mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
fix: remove messages when leaving a channel to avoid duplication when rejoining a chat
This commit is contained in:
parent
2bd3932cec
commit
2183cabad5
@ -25,7 +25,7 @@ proc handleChatEvents(self: ChatController) =
|
||||
self.view.setActiveChannel(channel.chat.id)
|
||||
|
||||
self.status.events.on("channelLeft") do(e: Args):
|
||||
discard self.view.chats.removeChatItemFromList(self.view.activeChannel.chatItem.id)
|
||||
self.view.removeChat(self.view.activeChannel.chatItem.id)
|
||||
|
||||
self.status.events.on("activeChannelChanged") do(e: Args):
|
||||
self.view.setActiveChannel(ChatIdArg(e).chatId)
|
||||
|
@ -195,6 +195,11 @@ QtObject:
|
||||
proc leaveActiveChat*(self: ChatsView) {.slot.} =
|
||||
self.status.chat.leave(self.activeChannel.id)
|
||||
|
||||
proc removeChat*(self: ChatsView, chatId: string) =
|
||||
discard self.chats.removeChatItemFromList(chatId)
|
||||
self.messageList[chatId].delete
|
||||
self.messageList.del(chatId)
|
||||
|
||||
proc clearChatHistory*(self: ChatsView, id: string) {.slot.} =
|
||||
self.status.chat.clearHistory(id)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user