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:
parent
f00d7f3ec4
commit
327eca96cb
|
@ -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")
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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]) =
|
||||
|
|
Loading…
Reference in New Issue