diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-07-18 18:02:54 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-07-26 11:25:54 +0100 |
| commit | 7106c34585f3db116307bc908f1eb1fbf51a73cf (patch) | |
| tree | 196e3baf05d1366ae59d8ac6f1fd0a189defec62 /gui/src/renderer/lib | |
| parent | ace147c273e058e85df619fb4300e3953cedd2dd (diff) | |
| download | mullvadvpn-7106c34585f3db116307bc908f1eb1fbf51a73cf.tar.xz mullvadvpn-7106c34585f3db116307bc908f1eb1fbf51a73cf.zip | |
Adjust GUI code to the new settings schema
Diffstat (limited to 'gui/src/renderer/lib')
| -rw-r--r-- | gui/src/renderer/lib/relay-settings-builder.ts | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/gui/src/renderer/lib/relay-settings-builder.ts b/gui/src/renderer/lib/relay-settings-builder.ts index 72dc95e759..bbf85b1fed 100644 --- a/gui/src/renderer/lib/relay-settings-builder.ts +++ b/gui/src/renderer/lib/relay-settings-builder.ts @@ -80,19 +80,13 @@ class NormalRelaySettingsBuilder { get tunnel(): ITunnelBuilder { const updateOpenvpn = (next: Partial<IOpenVpnConstraints>) => { - const tunnel = this.payload.tunnel; - if (typeof tunnel === 'string' || typeof tunnel === 'undefined') { - this.payload.tunnel = { - only: { - openvpn: next, - }, - }; - } else if (typeof tunnel === 'object') { - const prev = tunnel.only && 'openvpn' in tunnel.only ? tunnel.only.openvpn : {}; - this.payload.tunnel = { - only: { - openvpn: { ...prev, ...next }, - }, + if (this.payload.openvpnConstraints === undefined) { + this.payload.openvpnConstraints = next; + } else { + const prev = this.payload.openvpnConstraints; + this.payload.openvpnConstraints = { + ...prev, + ...next, }; } }; @@ -127,7 +121,7 @@ class NormalRelaySettingsBuilder { return this; }, any: () => { - this.payload.tunnel = 'any'; + this.payload.tunnelProtocol = 'any'; return this; }, }; |
