diff options
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/index.ts | 1 | ||||
| -rw-r--r-- | gui/src/main/notification-controller.ts | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index d6a01e6fd1..18dfc67d29 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -84,6 +84,7 @@ type AccountVerification = { status: 'verified' } | { status: 'deferred'; error: class ApplicationMain { private notificationController = new NotificationController({ + openApp: () => this.windowController?.show(), openLink: (url: string, withAuth?: boolean) => this.openLink(url, withAuth), isWindowVisible: () => this.windowController?.isVisible() ?? false, areSystemNotificationsEnabled: () => this.guiSettings.enableSystemNotifications, diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 20c29d0a41..387b7fc634 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -16,6 +16,7 @@ import { import consumePromise from '../shared/promise'; interface NotificationControllerDelegate { + openApp(): void; openLink(url: string, withAuth?: boolean): Promise<void>; isWindowVisible(): boolean; areSystemNotificationsEnabled(): boolean; @@ -114,9 +115,17 @@ export default class NotificationController { }); if (systemNotification.action) { - const { withAuth, url } = systemNotification.action; notification.on('click', () => { - consumePromise(this.notificationControllerDelegate.openLink(url, withAuth)); + consumePromise( + this.notificationControllerDelegate.openLink( + systemNotification.action!.url, + systemNotification.action!.withAuth, + ), + ); + }); + } else { + notification.on('click', () => { + this.notificationControllerDelegate.openApp(); }); } |
