diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2024-04-08 08:03:54 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2024-04-11 16:55:05 +0200 |
| commit | ab25e130af693d7a27fcff061fdaa3cfdbc4541a (patch) | |
| tree | 898a7b04801873d7d62d94470d73019c47cff35a /gui | |
| parent | d2e198cd8ce15225d4329cbb61f4561e293ea239 (diff) | |
| download | mullvadvpn-ab25e130af693d7a27fcff061fdaa3cfdbc4541a.tar.xz mullvadvpn-ab25e130af693d7a27fcff061fdaa3cfdbc4541a.zip | |
Only reset bridge location when normal is selected
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/main/settings.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gui/src/main/settings.ts b/gui/src/main/settings.ts index 16996eebd9..8bf60d9108 100644 --- a/gui/src/main/settings.ts +++ b/gui/src/main/settings.ts @@ -1,6 +1,5 @@ import fs from 'fs/promises'; -import BridgeSettingsBuilder from '../shared/bridge-settings-builder'; import { ISettings } from '../shared/daemon-rpc-types'; import { ICurrentAppVersionInfo } from '../shared/ipc-types'; import log from '../shared/logging'; @@ -44,9 +43,15 @@ export default class Settings implements Readonly<ISettings> { IpcMainEventChannel.settings.handleSetBridgeState(async (bridgeState) => { await this.daemonRpc.setBridgeState(bridgeState); - // Reset bridge constraints to `any` when the state is set to auto or off - if (bridgeState === 'auto' || bridgeState === 'off') { - await this.daemonRpc.setBridgeSettings(new BridgeSettingsBuilder().location.any().build()); + // Reset bridge constraints to `any` when the state is set to auto or off if not custom + if ( + (bridgeState === 'auto' || bridgeState === 'off') && + this.bridgeSettings.type === 'normal' + ) { + await this.daemonRpc.setBridgeSettings({ + ...this.bridgeSettings, + normal: { ...this.bridgeSettings.normal, location: 'any' }, + }); } }); IpcMainEventChannel.settings.handleSetOpenVpnMssfix((mssfix?: number) => |
