diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-12-01 14:01:22 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2023-02-09 10:39:26 +0100 |
| commit | 98b6bd1d3c879fd3be6e84ded04888758299dca5 (patch) | |
| tree | 0dc6392cf2134cc0a0d89b44de0ee052667b072b | |
| parent | 826ba978c05733311c7bbb852f6c00972cabee2e (diff) | |
| download | mullvadvpn-98b6bd1d3c879fd3be6e84ded04888758299dca5.tar.xz mullvadvpn-98b6bd1d3c879fd3be6e84ded04888758299dca5.zip | |
Add dispose method on notification controller
| -rw-r--r-- | gui/src/main/index.ts | 1 | ||||
| -rw-r--r-- | gui/src/main/notification-controller.ts | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index e6dc2901af..824e354333 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -316,6 +316,7 @@ class ApplicationMain log.info('Quit initiated'); this.userInterface?.dispose(); + this.notificationController.dispose(); // Unsubscribe the event handler try { diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 7682c60d15..67f54d7e06 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -60,6 +60,13 @@ export default class NotificationController { } } + public dispose() { + this.throttledNotifications.forEach((scheduler) => scheduler.cancel()); + + this.activeNotifications.forEach((notification) => notification.notification.close()); + this.activeNotifications.clear(); + } + public notifyTunnelState( tunnelState: TunnelState, blockWhenDisconnected: boolean, |
