Skip to content

Commit

Permalink
fix(community): Remove channels duplications
Browse files Browse the repository at this point in the history
Fixes: #10582
  • Loading branch information
borismelnik authored and jrainville committed May 16, 2023
1 parent 7728b53 commit 3342e1f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app_service/service/community/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,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)
Expand All @@ -817,9 +819,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}"
Expand Down

0 comments on commit 3342e1f

Please # to comment.