summaryrefslogtreecommitdiffhomepage
path: root/app/lib
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
parenta77e01a50b165fd8d6e2db96652a1fcc9a220723 (diff)
downloadmullvadvpn-7f6c8398eacb5421b51c1f02befde4e4f6402fc7.tar.xz
mullvadvpn-7f6c8398eacb5421b51c1f02befde4e4f6402fc7.zip
Redid the settings state and inlined a few components
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/backend.js14
-rw-r--r--app/lib/ipc-facade.js2
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: {