fix(community): Remove channels duplications

Fixes: #10582
This commit is contained in:
Boris Melnik 2023-05-15 18:41:57 +03:00
parent e34d28f881
commit 3d5c8f8024
1 changed files with 3 additions and 4 deletions

View File

@ -804,9 +804,11 @@ QtObject:
updatedCommunity.settings = communitySettings
self.communities[communityId] = updatedCommunity
# TODO improve this by only loading the data for the wanted community
self.chatService.loadChannelGroupById(communityId)
self.events.emit(SIGNAL_COMMUNITIES_UPDATE, CommunitiesArgs(communities: @[updatedCommunity]))
self.events.emit(SIGNAL_COMMUNITY_SPECTATED, CommunityArgs(community: updatedCommunity, fromUserAction: true))
for k, chat in updatedCommunity.chats:
let fullChatId = communityId & chat.id
let currentChat = self.chatService.getChatById(fullChatId, showWarning = false)
@ -819,9 +821,6 @@ QtObject:
# TODO find a way to populate missing infos like the color
self.chatService.updateOrAddChat(chatDto)
self.messageService.asyncLoadInitialMessagesForChat(fullChatId)
self.events.emit(SIGNAL_COMMUNITIES_UPDATE, CommunitiesArgs(communities: @[updatedCommunity]))
self.events.emit(SIGNAL_COMMUNITY_SPECTATED, CommunityArgs(community: updatedCommunity, fromUserAction: true))
except Exception as e:
error "Error joining the community", msg = e.msg
result = fmt"Error joining the community: {e.msg}"