summaryrefslogtreecommitdiffhomepage
path: root/app/lib/backend.js
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-11-09 09:03:45 +0100
committerErik Larkö <erik@mullvad.net>2017-11-09 09:03:45 +0100
commit7f6c8398eacb5421b51c1f02befde4e4f6402fc7 (patch)
tree93456d22efbf668e39147ffb50b3beee37272a8c /app/lib/backend.js
parenta77e01a50b165fd8d6e2db96652a1fcc9a220723 (diff)
downloadmullvadvpn-7f6c8398eacb5421b51c1f02befde4e4f6402fc7.tar.xz
mullvadvpn-7f6c8398eacb5421b51c1f02befde4e4f6402fc7.zip
Redid the settings state and inlined a few components
Diffstat (limited to 'app/lib/backend.js')
-rw-r--r--app/lib/backend.js14
1 files changed, 12 insertions, 2 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