fix: fix adding a second channel to a community disapearing

Fixes #1953
This commit is contained in:
Jonathan Rainville 2021-03-03 13:50:32 -05:00 committed by Iuri Matias
parent 2f8d46fa76
commit d1c6c0f9a9
2 changed files with 6 additions and 1 deletions

View File

@ -208,7 +208,7 @@ QtObject:
return "Chat was not created. Please try again later" return "Chat was not created. Please try again later"
self.joinedCommunityList.addChannelToCommunity(communityId, chat) self.joinedCommunityList.addChannelToCommunity(communityId, chat)
discard self.activeCommunity.chats.addChatItemToList(chat) self.activeCommunity.addChatItemToList(chat)
except Exception as e: except Exception as e:
error "Error creating the channel", msg = e.msg error "Error creating the channel", msg = e.msg
result = fmt"Error creating the channel: {e.msg}" result = fmt"Error creating the channel: {e.msg}"

View File

@ -133,6 +133,11 @@ QtObject:
self.chats.setChats(chats) self.chats.setChats(chats)
self.chatsChanged() self.chatsChanged()
proc addChatItemToList*(self: CommunityItemView, chat: Chat) =
self.communityItem.chats.add(chat)
discard self.chats.addChatItemToList(chat)
self.chatsChanged()
QtProperty[QVariant] chats: QtProperty[QVariant] chats:
read = getChats read = getChats
notify = chatsChanged notify = chatsChanged