diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2024-01-30 21:35:04 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2024-01-31 11:47:11 +0100 |
| commit | 76bf632eb552072db0f0c8a582a0d24f632f5bca (patch) | |
| tree | b25f77ff8371e31de453fee464f21cdacf25389b /gui/src/main | |
| parent | 91da61996b0f42789983df924f71a7ead8a1af74 (diff) | |
| download | mullvadvpn-76bf632eb552072db0f0c8a582a0d24f632f5bca.tar.xz mullvadvpn-76bf632eb552072db0f0c8a582a0d24f632f5bca.zip | |
Update disconnected from daemon system notification
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/index.ts | 7 | ||||
| -rw-r--r-- | gui/src/main/notification-controller.ts | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 37f6eaa590..635b0ad79e 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -623,6 +623,13 @@ class ApplicationMain // Reset the daemon event listener since it's going to be invalidated on disconnect this.daemonEventListener = undefined; + if (this.tunnelState.tunnelState.state !== 'disconnected') { + this.notificationController.notifyDaemonDisconnected( + this.userInterface?.isWindowVisible() ?? false, + this.settings.gui.enableSystemNotifications, + ); + } + this.tunnelState.resetFallback(); if (wasConnected) { diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 8751ecb6ae..3639ac25eb 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -7,6 +7,7 @@ import log from '../shared/logging'; import { ConnectedNotificationProvider, ConnectingNotificationProvider, + DaemonDisconnectedNotificationProvider, DisconnectedNotificationProvider, ErrorNotificationProvider, NotificationAction, @@ -120,6 +121,14 @@ export default class NotificationController { return false; } + public notifyDaemonDisconnected(windowVisible: boolean, infoNotificationsEnabled: boolean) { + this.notify( + new DaemonDisconnectedNotificationProvider().getSystemNotification(), + windowVisible, + infoNotificationsEnabled, + ); + } + // Closes still relevant notifications but still lets them affect notification dot in tray icon. public dismissActiveNotifications() { this.activeNotifications.forEach((notification) => { |
