diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-04-09 22:10:52 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-05-28 13:25:30 +0200 |
| commit | 2c7bbd464e5e89e75850450e09dc2507f3a1ce6c (patch) | |
| tree | 9bba127d9614a80c4125c53be64815de55b43bd5 | |
| parent | 21dcd0b2820d4a3f0467d31a275a8dd917e669bf (diff) | |
| download | mullvadvpn-2c7bbd464e5e89e75850450e09dc2507f3a1ce6c.tar.xz mullvadvpn-2c7bbd464e5e89e75850450e09dc2507f3a1ce6c.zip | |
Refactor logic for when to start installer
Mainly to be easier to read.
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/app.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/app.tsx b/desktop/packages/mullvad-vpn/src/renderer/app.tsx index c65541bc73..595f0c71de 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/app.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/app.tsx @@ -416,15 +416,15 @@ export default class AppRenderer { const appUpgradeEvent = reduxState.appUpgrade.event; const appUpgradeError = reduxState.appUpgrade.error; const verifiedInstallerPath = reduxState.version.suggestedUpgrade?.verifiedInstallerPath; + const hasVerifiedInstallerPath = + typeof verifiedInstallerPath === 'string' && verifiedInstallerPath.length > 0; // Ensure we have a the path to the verified installer and that we are not already trying // to start the installer. if ( - typeof verifiedInstallerPath === 'string' && - verifiedInstallerPath.length > 0 && + hasVerifiedInstallerPath && (appUpgradeEvent?.type !== 'APP_UPGRADE_STATUS_STARTING_INSTALLER' || - (appUpgradeEvent?.type === 'APP_UPGRADE_STATUS_STARTING_INSTALLER' && - appUpgradeError === 'START_INSTALLER_FAILED')) + appUpgradeError === 'START_INSTALLER_FAILED') ) { // Ensure we don't try to start the installer multiple times by setting the status // as starting |
