From 19f5ce8de0315a6c4780f96f8cfa7f10e219e932 Mon Sep 17 00:00:00 2001 From: Noelia Date: Mon, 7 Feb 2022 07:42:26 +0100 Subject: [PATCH] fix(@desktop/communities): Newly created Community remains highlighted Fixed switching/highlight between community and regular navigation button after a newly created and edited communities. Active property value in createCommunityItem(..) has been set depending on if the current active section corresponds with the item we are going to create. Fixes #4519 --- src/app/modules/main/module.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index 2aebb4da6a..27f2253c67 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -165,6 +165,7 @@ proc createCommunityItem[T](self: Module[T], c: CommunityDto): SectionItem = let (unviewedCount, mentionsCount) = self.controller.getNumOfNotificationsForCommunity(c.id) let hasNotification = unviewedCount > 0 or mentionsCount > 0 let notificationsCount = mentionsCount # we need to add here number of requests + let active = self.getActiveSectionId() == c.id # We must pass on if the current item section is currently active to keep that property as it is result = initItem( c.id, SectionType.Community, @@ -176,7 +177,7 @@ proc createCommunityItem[T](self: Module[T], c: CommunityDto): SectionItem = c.color, hasNotification, notificationsCount, - active = false, + active, enabled = singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled(), c.joined, c.canJoin,