summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-11-11 18:04:15 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-11-13 19:53:59 +0100
commit90db7b7922192cc96eae37caa1f20e2fefe6bc15 (patch)
treefa371841095d5ff8f3f0a25908d436f514d2b50c /gui/src/main
parent52499b482483ba1dac7fc8d756f2bf671362b178 (diff)
downloadmullvadvpn-90db7b7922192cc96eae37caa1f20e2fefe6bc15.tar.xz
mullvadvpn-90db7b7922192cc96eae37caa1f20e2fefe6bc15.zip
Update notification messages
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/index.ts21
-rw-r--r--gui/src/main/notification-controller.ts4
2 files changed, 16 insertions, 9 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 95cfc35a55..514fa4b4e8 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -40,6 +40,7 @@ import {
CloseToAccountExpiryNotificationProvider,
InconsistentVersionNotificationProvider,
UnsupportedVersionNotificationProvider,
+ UpdateAvailableNotificationProvider,
} from '../shared/notifications/notification';
import consumePromise from '../shared/promise';
import { Scheduler } from '../shared/scheduler';
@@ -802,12 +803,20 @@ class ApplicationMain {
this.upgradeVersion = latestVersionInfo;
// notify user to update the app if it became unsupported
- const notificationProvider = new UnsupportedVersionNotificationProvider({
- supported: latestVersionInfo.supported,
- consistent: this.currentVersion.isConsistent,
- suggestedUpgrade: latestVersionInfo.suggestedUpgrade,
- });
- if (notificationProvider.mayDisplay()) {
+ const notificationProviders = [
+ new UnsupportedVersionNotificationProvider({
+ supported: latestVersionInfo.supported,
+ consistent: this.currentVersion.isConsistent,
+ suggestedUpgrade: latestVersionInfo.suggestedUpgrade,
+ }),
+ new UpdateAvailableNotificationProvider({
+ suggestedUpgrade: latestVersionInfo.suggestedUpgrade,
+ }),
+ ];
+ const notificationProvider = notificationProviders.find((notificationProvider) =>
+ notificationProvider.mayDisplay(),
+ );
+ if (notificationProvider) {
this.notificationController.notify(notificationProvider.getSystemNotification());
}
diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts
index c5c30b42ef..95c1216b72 100644
--- a/gui/src/main/notification-controller.ts
+++ b/gui/src/main/notification-controller.ts
@@ -4,7 +4,6 @@ import os from 'os';
import path from 'path';
import { TunnelState } from '../shared/daemon-rpc-types';
import {
- BlockWhenDisconnectedNotificationProvider,
ConnectedNotificationProvider,
ConnectingNotificationProvider,
DisconnectedNotificationProvider,
@@ -58,8 +57,7 @@ export default class NotificationController {
new ConnectingNotificationProvider({ tunnelState, reconnecting: this.reconnecting }),
new ConnectedNotificationProvider(tunnelState),
new ReconnectingNotificationProvider(tunnelState),
- new BlockWhenDisconnectedNotificationProvider({ tunnelState, blockWhenDisconnected }),
- new DisconnectedNotificationProvider(tunnelState),
+ new DisconnectedNotificationProvider({ tunnelState, blockWhenDisconnected }),
new ErrorNotificationProvider({ tunnelState, accountExpiry }),
];