fix(@desktop/communities): Fix for app doesn't preserve selected community chat

fixes #3486
This commit is contained in:
Khushboo Mehta 2021-09-17 16:34:44 +02:00 committed by Iuri Matias
parent 214069cb25
commit e6f8a79f67
1 changed files with 4 additions and 1 deletions

View File

@ -164,7 +164,10 @@ QtObject:
let selectedChannel = self.getChannelById(channel)
self.activeChannel.setChatItem(selectedChannel)
if not self.communities.activeCommunity.active:
if (self.communities.activeCommunity.active and self.communities.activeCommunity.communityItem.lastChannelSeen != selectedChannel.id):
self.communities.activeCommunity.communityItem.lastChannelSeen = selectedChannel.id
self.communities.joinedCommunityList.replaceCommunity(self.communities.activeCommunity.communityItem)
elif not self.communities.activeCommunity.active:
self.previousActiveChannelIndex = self.chats.chats.findIndexById(self.activeChannel.id)
self.appService.chatService.asyncMarkAllChannelMessagesRead(self.activeChannel.id)