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
|
if (selectedChannel == nil): return false
|
||||||
result = selectedChannel.muted
|
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) =
|
proc removeChat*(self: ChannelView, chatId: string) =
|
||||||
discard self.chats.removeChatItemFromList(chatId)
|
discard self.chats.removeChatItemFromList(chatId)
|
||||||
self.setActiveChannel(backToFirstChat)
|
self.setActiveChannel(backToFirstChat)
|
||||||
|
|
|
@ -228,9 +228,12 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
chatListPopupMenu: ChatContextMenuView {
|
chatListPopupMenu: ChatContextMenuView {
|
||||||
|
id: chatContextMenuView
|
||||||
store: root.store
|
store: root.store
|
||||||
openHandler: function (id) {
|
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)
|
onChatItemUnmuted: root.store.chatsModelInst.channelView.unmuteChatItem(id)
|
||||||
|
|
||||||
popupMenu: ChatContextMenuView {
|
popupMenu: ChatContextMenuView {
|
||||||
|
id: chatContextMenuView
|
||||||
store: root.store
|
store: root.store
|
||||||
openHandler: function (id) {
|
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