fix: context menu losing data and group info being empty sometimes

This commit is contained in:
Jonathan Rainville 2021-11-03 15:35:12 -04:00 committed by Iuri Matias
parent d53548f68c
commit 894e57fbdb
3 changed files with 7 additions and 8 deletions

View File

@ -305,12 +305,6 @@ QtObject:
if (selectedChannel == nil): return false
result = selectedChannel.muted
proc getChatItemById*(self: ChannelView, id: string): QObject {.slot.} =
let chat = self.getChannelById(id)
let chatItemView = newChatItemView(self.status)
chatItemView.setChatItem(chat)
return chatItemView
proc removeChat*(self: ChannelView, chatId: string) =
discard self.chats.removeChatItemFromList(chatId)
self.setActiveChannel(backToFirstChat)

View File

@ -228,9 +228,12 @@ Item {
}
chatListPopupMenu: ChatContextMenuView {
id: chatContextMenuView
store: root.store
openHandler: function (id) {
chatItem = root.store.chatsModelInst.channelView.getChatItemById(id)
root.store.chatsModelInst.channelView.setContextChannel(id)
chatContextMenuView.chatItem = root.store.chatsModelInst.channelView.contextChannel
}
}
}

View File

@ -259,9 +259,11 @@ Item {
onChatItemUnmuted: root.store.chatsModelInst.channelView.unmuteChatItem(id)
popupMenu: ChatContextMenuView {
id: chatContextMenuView
store: root.store
openHandler: function (id) {
chatItem = root.store.chatsModelInst.channelView.getChatItemById(id)
root.store.chatsModelInst.channelView.setContextChannel(id)
chatContextMenuView.chatItem = root.store.chatsModelInst.channelView.contextChannel
}
}
}