summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-10-17 16:40:38 +0200
committerJoakim Hulthe <joakim.hulthe@mullvad.net>2025-10-23 10:23:01 +0200
commitd7624835621c44624871dc996edbd11fe8a3ec06 (patch)
tree0b0f1277b92ea5df404d845679b0eea69455dea1
parenta0ffef71d4d9843f951353a4dc54ff82ec255782 (diff)
downloadmullvadvpn-d7624835621c44624871dc996edbd11fe8a3ec06.tar.xz
mullvadvpn-d7624835621c44624871dc996edbd11fe8a3ec06.zip
Make sure link to app upgrade view only appears on supported platforms
-rw-r--r--desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts35
1 files changed, 22 insertions, 13 deletions
diff --git a/desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts b/desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts
index 6559e02a21..3054a4cf81 100644
--- a/desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts
+++ b/desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts
@@ -4,6 +4,7 @@ import { AppVersionInfoSuggestedUpgrade } from '../daemon-rpc-types';
import { getDownloadUrl } from '../version';
import {
InAppNotification,
+ InAppNotificationAction,
InAppNotificationProvider,
SystemNotification,
SystemNotificationCategory,
@@ -69,24 +70,32 @@ export class UnsupportedVersionNotificationProvider
// TRANSLATORS: A link in the in-app banner to encourage the user to update the app.
// TRANSLATORS: The in-app banner is is displayed to the user when the running app becomes unsupported.
messages.pgettext('notifications', 'Please click here to update now'),
- action: this.context.suggestedUpgrade
- ? {
- type: 'navigate-internal',
- link: {
- to: RoutePath.appUpgrade,
- },
- }
- : {
- type: 'navigate-external',
- link: {
- to: getDownloadUrl(this.context.suggestedIsBeta ?? false),
- },
- },
+ action: this.getInAppNotificationAction(),
},
],
};
}
+ private getInAppNotificationAction(): InAppNotificationAction {
+ if (this.context.suggestedUpgrade) {
+ if (process.platform !== 'linux') {
+ return {
+ type: 'navigate-internal',
+ link: {
+ to: RoutePath.appUpgrade,
+ },
+ };
+ }
+ }
+
+ return {
+ type: 'navigate-external',
+ link: {
+ to: getDownloadUrl(this.context.suggestedIsBeta ?? false),
+ },
+ };
+ }
+
private getMessage(): string {
// TRANSLATORS: The system notification which is displayed to the user when the running app becomes unsupported.
return messages.pgettext(