summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-04-09 22:10:52 +0200
committerSebastian Holmin <sebastian.holmin@mullvad.net>2025-05-28 13:25:30 +0200
commit2c7bbd464e5e89e75850450e09dc2507f3a1ce6c (patch)
tree9bba127d9614a80c4125c53be64815de55b43bd5
parent21dcd0b2820d4a3f0467d31a275a8dd917e669bf (diff)
downloadmullvadvpn-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.tsx8
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