summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-11-21 15:48:20 +0100
committerAndrej Mihajlov <and@mullvad.net>2017-11-23 12:41:13 +0100
commitabb6dae7b765755d4c687401384095b44e931279 (patch)
tree557b85736b8e746b9842443a21ff164c7d2423d9 /app
parent3f378094189d542cad7deac5b3b919f724c96758 (diff)
downloadmullvadvpn-abb6dae7b765755d4c687401384095b44e931279.tar.xz
mullvadvpn-abb6dae7b765755d4c687401384095b44e931279.zip
Fix flow annotations
Diffstat (limited to 'app')
-rw-r--r--app/lib/backend.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index 1b76bc4414..7aa67dc84b 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -315,18 +315,15 @@ export class Backend {
syncRelaySettings(): Promise<void> {
return this._ensureAuthenticated()
- .then( () => {
- return this._ipc.getRelaySettings();
- })
- .then( constraints => {
- log.debug('Got constraints from backend', constraints);
-
- const { custom_tunnel_endpoint, normal } = constraints;
-
- if(normal) {
+ .then(() => this._ipc.getRelaySettings())
+ .then((constraints) => {
+ log.debug('Got constraints from backend', constraints)
+ if(constraints.normal) {
+ const normal = constraints.normal;
// TODO: handle normal constraints
log.warn('syncRelaySettings: Normal constraints are not implemented yet.');
- } else if(custom_tunnel_endpoint) {
+ } else if(constraints.custom_tunnel_endpoint) {
+ const custom_tunnel_endpoint = constraints.custom_tunnel_endpoint;
const { host, tunnel: { openvpn } } = custom_tunnel_endpoint;
this._store.dispatch(settingsActions.updateRelay({
host: host,
@@ -335,7 +332,7 @@ export class Backend {
}));
}
})
- .catch( e => {
+ .catch(e => {
log.error('Failed getting relay constraints', e);
});
}