fix: context menu losing data and group info being empty sometimes
This commit is contained in:
parent
d53548f68c
commit
894e57fbdb
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue