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"
self.joinedCommunityList.addChannelToCommunity(communityId, chat)
discard self.activeCommunity.chats.addChatItemToList(chat)
self.activeCommunity.addChatItemToList(chat)
except Exception as e:
error "Error creating the channel", msg = e.msg
result = fmt"Error creating the channel: {e.msg}"

View File

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