summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/lib/backend.js30
1 files changed, 28 insertions, 2 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index f78d359926..da87deced4 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -139,6 +139,12 @@ export class Backend {
log.error('Failed to fetch the location: ', e.message);
}
+ try {
+ await this._fetchAllowLan();
+ } catch(e) {
+ log.error('Failed to fetch the LAN sharing policy: ', e.message);
+ }
+
await this._fetchAccountHistory();
}
@@ -339,8 +345,6 @@ export class Backend {
}
}
-
-
async _fetchRelayLocations() {
await this._ensureAuthenticated();
@@ -395,6 +399,28 @@ export class Backend {
);
}
+ async setAllowLan(allowLan: boolean) {
+ try {
+ await this._ensureAuthenticated();
+ await this._ipc.setAllowLan(allowLan);
+
+ this._store.dispatch(
+ settingsActions.updateAllowLan(allowLan)
+ );
+ } catch(e) {
+ log.error('Failed to change the LAN sharing policy: ', e.message);
+ }
+ }
+
+ async _fetchAllowLan() {
+ await this._ensureAuthenticated();
+
+ const allowLan = await this._ipc.getAllowLan();
+ this._store.dispatch(
+ settingsActions.updateAllowLan(allowLan)
+ );
+ }
+
/**
* Start reachability monitoring for online/offline detection
* This is currently done via HTML5 APIs but will be replaced later