diff options
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/backend.js | 14 | ||||
| -rw-r--r-- | app/lib/ipc-facade.js | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js index 89a895b4c4..7e5e21708f 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -317,11 +317,13 @@ export class Backend { const host = constraints.host === 'any' ? defaultServer - : constraints.host || defaultServer; + : constraints.host.only || defaultServer; + const openvpn = constraints.tunnel.openvpn; this._store.dispatch(settingsActions.updateRelay({ host: host, - tunnel: constraints.tunnel, + port: this._apiToReduxConstraints(openvpn.port), + protocol: this._apiToReduxConstraints(openvpn.protocol), })); }) .catch( e => { @@ -329,6 +331,14 @@ export class Backend { }); } + _apiToReduxConstraints(constraint: *): * { + if (typeof(constraint) === 'object') { + return constraint.only; + } else { + return constraint; + } + } + /** * Start reachability monitoring for online/offline detection * This is currently done via HTML5 APIs but will be replaced later diff --git a/app/lib/ipc-facade.js b/app/lib/ipc-facade.js index 9f3f900331..7a71861ae5 100644 --- a/app/lib/ipc-facade.js +++ b/app/lib/ipc-facade.js @@ -25,7 +25,7 @@ export type BackendState = { state: SecurityState, target_state: SecurityState, }; -export type RelayConstraints = { +type RelayConstraints = { host: 'any' | { only: string }, tunnel: { openvpn: { |
