diff options
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/lib/notifications/app-upgrade-error.ts | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/app-upgrade-error.ts b/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/app-upgrade-error.ts index 5b637ec0e2..5b704a8161 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/app-upgrade-error.ts +++ b/desktop/packages/mullvad-vpn/src/renderer/lib/notifications/app-upgrade-error.ts @@ -10,15 +10,14 @@ interface AppUpgradeErrorNotificationContext { hasAppUpgradeError: boolean; appUpgradeError?: AppUpgradeError; restartAppUpgrade: () => void; + restartAppUpgradeInstaller: () => void; } export class AppUpgradeErrorNotificationProvider implements InAppNotificationProvider { public constructor(private context: AppUpgradeErrorNotificationContext) {} public mayDisplay = () => { - return ( - this.context.hasAppUpgradeError && this.context.appUpgradeError !== 'START_INSTALLER_FAILED' - ); + return this.context.hasAppUpgradeError; }; public getInAppNotification(): InAppNotification { @@ -73,6 +72,39 @@ export class AppUpgradeErrorNotificationProvider implements InAppNotificationPro }; } + if (appUpgradeError === 'START_INSTALLER_FAILED') { + return { + indicator: 'error', + title: + // TRANSLATORS: Notification title when the installer failed. + messages.pgettext('in-app-notifications', 'INSTALLER FAILED'), + subtitle: [ + { + content: + // TRANSLATORS: Notification subtitle when the installer failed. + messages.pgettext( + 'in-app-notifications', + 'The installer did not start successfully.', + ), + }, + { + content: + // TRANSLATORS: Notification subtitle when the installer failed. + messages.pgettext('in-app-notifications', 'Click here to retry'), + action: { + type: 'run-function', + button: { + onClick: () => this.context.restartAppUpgradeInstaller(), + 'aria-label': + // TRANSLATORS: Accessibility label for the button to retry the installation. + messages.pgettext('in-app-notifications', 'Retry installation'), + }, + }, + }, + ], + }; + } + if (appUpgradeError === 'INSTALLER_FAILED') { return { indicator: 'error', |
