summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-07-10 20:14:39 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-07-16 11:19:29 +0200
commitc541398e0f593789e40f6b24ff3272971fa6a53d (patch)
treeaf94a82d54384dc5b18fa4d659a3451d42eb2014
parent211df037c1bf56169e82ab68a167986c556f9889 (diff)
downloadmullvadvpn-c541398e0f593789e40f6b24ff3272971fa6a53d.tar.xz
mullvadvpn-c541398e0f593789e40f6b24ff3272971fa6a53d.zip
Add app logic to fetch and set autoConnect
-rw-r--r--app/app.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/app.js b/app/app.js
index 187c0a7fef..76d92a1b55 100644
--- a/app/app.js
+++ b/app/app.js
@@ -343,12 +343,24 @@ export default class AppRenderer {
actions.settings.updateAllowLan(allowLan);
}
+ async setAutoConnect(autoConnect: boolean) {
+ const actions = this._reduxActions;
+ await this._daemonRpc.setAutoConnect(autoConnect);
+ actions.settings.updateAutoConnect(autoConnect);
+ }
+
async _fetchAllowLan() {
const actions = this._reduxActions;
const allowLan = await this._daemonRpc.getAllowLan();
actions.settings.updateAllowLan(allowLan);
}
+ async _fetchAutoConnect() {
+ const actions = this._reduxActions;
+ const autoConnect = await this._daemonRpc.getAutoConnect();
+ actions.settings.updateAutoConnect(autoConnect);
+ }
+
async _fetchSecurityState() {
const securityState = await this._daemonRpc.getState();
const connectionState = this._securityStateToConnectionState(securityState);
@@ -485,6 +497,7 @@ export default class AppRenderer {
this.fetchRelaySettings(),
this._fetchRelayLocations(),
this._fetchAllowLan(),
+ this._fetchAutoConnect(),
this._fetchLocation(),
this._fetchAccountHistory(),
]);