From e6f8a79f67efd428d6fa2567a6a30903c6804197 Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Fri, 17 Sep 2021 16:34:44 +0200 Subject: [PATCH] fix(@desktop/communities): Fix for app doesn't preserve selected community chat fixes #3486 --- src/app/chat/views/channel.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/chat/views/channel.nim b/src/app/chat/views/channel.nim index 2d9bedd20b..daea61d2be 100644 --- a/src/app/chat/views/channel.nim +++ b/src/app/chat/views/channel.nim @@ -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)