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 committed May 15, 2023
1 parent a93d2f8 commit a528f72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app_service/service/community/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,9 @@ QtObject:
# 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 @@ -819,9 +822,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 a528f72

Please sign in to comment.