fix(notifications): [re-add] fix notification setup called too soon
Fixes #4702
This commit is contained in:
parent
4341d12efc
commit
20a2d48eea
|
@ -339,6 +339,8 @@ proc userLoggedIn*(self: AppController) =
|
|||
if(importedAccount.isValid()):
|
||||
self.privacyService.removeMnemonic()
|
||||
|
||||
self.osNotificationService.userLoggedIn()
|
||||
|
||||
proc buildAndRegisterLocalAccountSensitiveSettings(self: AppController) =
|
||||
var pubKey = self.settingsService.getPublicKey()
|
||||
singletonInstance.localAccountSensitiveSettings.setFileName(pubKey)
|
||||
|
|
|
@ -17,15 +17,15 @@ QtObject:
|
|||
type Service* = ref object of QObject
|
||||
events: EventEmitter
|
||||
notification: StatusOSNotification
|
||||
notificationSetUp: bool
|
||||
|
||||
proc setup(self: Service, events: EventEmitter) =
|
||||
self.QObject.setup
|
||||
self.events = events
|
||||
self.notification = newStatusOSNotification()
|
||||
signalConnect(self.notification, "notificationClicked(QString)", self, "onNotificationClicked(QString)", 2)
|
||||
|
||||
proc delete*(self: Service) =
|
||||
self.notification.delete
|
||||
if self.notificationSetUp:
|
||||
self.notification.delete
|
||||
self.QObject.delete
|
||||
|
||||
proc newService*(events: EventEmitter): Service =
|
||||
|
@ -52,3 +52,8 @@ QtObject:
|
|||
## contains data which uniquely define that notification.
|
||||
let details = toOsNotificationDetails(parseJson(identifier))
|
||||
self.events.emit(SIGNAL_OS_NOTIFICATION_CLICKED, OsNotificationsArgs(details: details))
|
||||
|
||||
proc userLoggedIn*(self: Service) =
|
||||
self.notification = newStatusOSNotification()
|
||||
signalConnect(self.notification, "notificationClicked(QString)", self, "onNotificationClicked(QString)", 2)
|
||||
self.notificationSetUp = true
|
Loading…
Reference in New Issue