summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main/index.ts
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/index.ts
parent52499b482483ba1dac7fc8d756f2bf671362b178 (diff)
downloadmullvadvpn-90db7b7922192cc96eae37caa1f20e2fefe6bc15.tar.xz
mullvadvpn-90db7b7922192cc96eae37caa1f20e2fefe6bc15.zip
Update notification messages
Diffstat (limited to 'gui/src/main/index.ts')
-rw-r--r--gui/src/main/index.ts21
1 files changed, 15 insertions, 6 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());
}