mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-20 03:20:24 +00:00
fix(notifications): fix notification setup called too soon
This commit is contained in:
parent
22181ea0ee
commit
1a0fb268e3
@ -50,3 +50,4 @@ proc delete*(self: AppService) =
|
||||
|
||||
proc onLoggedIn*(self: AppService) =
|
||||
self.marathon.onLoggedIn()
|
||||
self.osNotificationService.onLoggedIn()
|
||||
|
@ -11,16 +11,15 @@ QtObject:
|
||||
type OsNotificationService* = ref object of QObject
|
||||
status: Status
|
||||
notification: StatusOSNotification
|
||||
notificationSetUp: bool
|
||||
|
||||
proc setup(self: OsNotificationService, status: Status) =
|
||||
self.QObject.setup
|
||||
self.status = status
|
||||
self.notification = newStatusOSNotification()
|
||||
signalConnect(self.notification, "notificationClicked(QString)", self,
|
||||
"onNotificationClicked(QString)", 2)
|
||||
|
||||
proc delete*(self: OsNotificationService) =
|
||||
self.notification.delete
|
||||
if self.notificationSetUp:
|
||||
self.notification.delete
|
||||
self.QObject.delete
|
||||
|
||||
proc newOsNotificationService*(status: Status): OsNotificationService =
|
||||
@ -45,4 +44,9 @@ QtObject:
|
||||
proc onNotificationClicked*(self: OsNotificationService, identifier: string) {.slot.} =
|
||||
## This slot is called once user clicks a notificaiton bubble, "identifier"
|
||||
## contains data which uniquely define that notification.
|
||||
self.status.osnotifications.onNotificationClicked(identifier)
|
||||
self.status.osnotifications.onNotificationClicked(identifier)
|
||||
|
||||
proc onLoggedIn*(self: OsNotificationService) =
|
||||
self.notification = newStatusOSNotification()
|
||||
self.notificationSetUp = true
|
||||
signalConnect(self.notification, "notificationClicked(QString)", self, "onNotificationClicked(QString)", 2)
|
Loading…
x
Reference in New Issue
Block a user