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
This commit is contained in:
parent
5ebafb1c0c
commit
19f5ce8de0
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue