diff options
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/components/NotificationArea.tsx | 7 | ||||
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/lib/notifications/app-upgrade-error.ts | 33 |
2 files changed, 39 insertions, 1 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/NotificationArea.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/NotificationArea.tsx index ab9eb13133..d23d0813f2 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/NotificationArea.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/NotificationArea.tsx @@ -80,7 +80,8 @@ export default function NotificationArea(props: IProps) { const { hideNewDeviceBanner } = useActions(accountActions); - const { setDisplayedChangelog, setDismissedUpgrade, appUpgrade } = useAppContext(); + const { setDisplayedChangelog, setDismissedUpgrade, appUpgrade, appUpgradeInstallerStart } = + useAppContext(); const currentVersion = useSelector((state) => state.version.current); const displayedForVersion = useSelector( @@ -109,6 +110,9 @@ export default function NotificationArea(props: IProps) { const restartAppUpgrade = useCallback(() => { appUpgrade(); }, [appUpgrade]); + const restartAppUpgradeInstaller = useCallback(() => { + appUpgradeInstallerStart(); + }, [appUpgradeInstallerStart]); const shouldAppUpgradeInstallManually = useShouldAppUpgradeInstallManually(); const { suggestedUpgrade } = useVersionSuggestedUpgrade(); @@ -129,6 +133,7 @@ export default function NotificationArea(props: IProps) { hasAppUpgradeError, appUpgradeError: error, restartAppUpgrade, + restartAppUpgradeInstaller, }), new AppUpgradeReadyNotificationProvider({ shouldAppUpgradeInstallManually, 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 68c9986cb1..5b637ec0e2 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 @@ -72,6 +72,39 @@ export class AppUpgradeErrorNotificationProvider implements InAppNotificationPro ], }; } + + if (appUpgradeError === '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 complete 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'), + }, + }, + }, + ], + }; + } } return { |
