fix(red-dot): fix getting the real state of the AC notification count (#16024)

Fixes #16021

The problem was that the view doesn't update in a sync way, so getting the count from the view might be wrong.

This fix makes it so we have to get the count from status-go twice, which is not ideal, but to fix it, we'd need a refactor of the AC view count mechanism
This commit is contained in:
Jonathan Rainville 2024-08-13 12:25:29 -04:00 committed by GitHub
parent f00d7f3ec4
commit 327eca96cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1 additions and 7 deletions

View File

@ -21,9 +21,6 @@ method viewDidLoad*(self: AccessInterface) {.base.} =
method hasMoreToShow*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method unreadActivityCenterNotificationsCountFromView*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method unreadActivityCenterNotificationsCount*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -68,9 +68,6 @@ method viewDidLoad*(self: Module) =
method hasMoreToShow*(self: Module): bool =
self.controller.hasMoreToShow()
method unreadActivityCenterNotificationsCountFromView*(self: Module): int =
self.view.unreadCount()
method unreadActivityCenterNotificationsCount*(self: Module): int =
self.controller.unreadActivityCenterNotificationsCount()

View File

@ -963,7 +963,7 @@ method onChatLeft*[T](self: Module[T], chatId: string) =
proc checkIfWeHaveNotifications[T](self: Module[T]) =
let sectionWithUnread = self.view.model().isThereASectionWithUnreadMessages()
let activtyCenterNotifications = self.activityCenterModule.unreadActivityCenterNotificationsCountFromView() > 0
let activtyCenterNotifications = self.activityCenterModule.unreadActivityCenterNotificationsCount() > 0
self.view.setNotificationAvailable(sectionWithUnread or activtyCenterNotifications)
method onActivityNotificationsUpdated[T](self: Module[T]) =