mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 17:19:02 +00:00
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.} =
|
method hasMoreToShow*(self: AccessInterface): bool {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method unreadActivityCenterNotificationsCountFromView*(self: AccessInterface): int {.base.} =
|
|
||||||
raise newException(ValueError, "No implementation available")
|
|
||||||
|
|
||||||
method unreadActivityCenterNotificationsCount*(self: AccessInterface): int {.base.} =
|
method unreadActivityCenterNotificationsCount*(self: AccessInterface): int {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -68,9 +68,6 @@ method viewDidLoad*(self: Module) =
|
|||||||
method hasMoreToShow*(self: Module): bool =
|
method hasMoreToShow*(self: Module): bool =
|
||||||
self.controller.hasMoreToShow()
|
self.controller.hasMoreToShow()
|
||||||
|
|
||||||
method unreadActivityCenterNotificationsCountFromView*(self: Module): int =
|
|
||||||
self.view.unreadCount()
|
|
||||||
|
|
||||||
method unreadActivityCenterNotificationsCount*(self: Module): int =
|
method unreadActivityCenterNotificationsCount*(self: Module): int =
|
||||||
self.controller.unreadActivityCenterNotificationsCount()
|
self.controller.unreadActivityCenterNotificationsCount()
|
||||||
|
|
||||||
|
@ -963,7 +963,7 @@ method onChatLeft*[T](self: Module[T], chatId: string) =
|
|||||||
|
|
||||||
proc checkIfWeHaveNotifications[T](self: Module[T]) =
|
proc checkIfWeHaveNotifications[T](self: Module[T]) =
|
||||||
let sectionWithUnread = self.view.model().isThereASectionWithUnreadMessages()
|
let sectionWithUnread = self.view.model().isThereASectionWithUnreadMessages()
|
||||||
let activtyCenterNotifications = self.activityCenterModule.unreadActivityCenterNotificationsCountFromView() > 0
|
let activtyCenterNotifications = self.activityCenterModule.unreadActivityCenterNotificationsCount() > 0
|
||||||
self.view.setNotificationAvailable(sectionWithUnread or activtyCenterNotifications)
|
self.view.setNotificationAvailable(sectionWithUnread or activtyCenterNotifications)
|
||||||
|
|
||||||
method onActivityNotificationsUpdated[T](self: Module[T]) =
|
method onActivityNotificationsUpdated[T](self: Module[T]) =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user