diff options
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts | 41 |
1 files changed, 28 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 87138843a1..086b924a92 100644 --- a/desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts +++ b/desktop/packages/mullvad-vpn/src/shared/notifications/unsupported-version.ts @@ -1,4 +1,5 @@ import { messages } from '../../shared/gettext'; +import { RoutePath } from '../../shared/routes'; import { AppVersionInfoSuggestedUpgrade } from '../daemon-rpc-types'; import { getDownloadUrl } from '../version'; import { @@ -31,13 +32,20 @@ export class UnsupportedVersionNotificationProvider message: this.getMessage(), category: SystemNotificationCategory.newVersion, severity: SystemNotificationSeverityType.high, - action: { - type: 'navigate-external', - link: { - text: messages.pgettext('notifications', 'Upgrade'), - to: getDownloadUrl(this.context.suggestedIsBeta ?? false), - }, - }, + action: this.context.suggestedUpgrade + ? { + type: 'navigate-internal', + link: { + to: RoutePath.appUpgrade, + }, + } + : { + type: 'navigate-external', + link: { + text: messages.pgettext('notifications', 'Upgrade'), + to: getDownloadUrl(this.context.suggestedIsBeta ?? false), + }, + }, presentOnce: { value: true, name: this.constructor.name }, suppressInDevelopment: true, }; @@ -48,12 +56,19 @@ export class UnsupportedVersionNotificationProvider indicator: 'error', title: messages.pgettext('in-app-notifications', 'UNSUPPORTED VERSION'), subtitle: this.getMessage(), - action: { - type: 'navigate-external', - link: { - to: getDownloadUrl(this.context.suggestedIsBeta ?? false), - }, - }, + action: this.context.suggestedUpgrade + ? { + type: 'navigate-internal', + link: { + to: RoutePath.appUpgrade, + }, + } + : { + type: 'navigate-external', + link: { + to: getDownloadUrl(this.context.suggestedIsBeta ?? false), + }, + }, }; } |
