aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/server/LocalApi.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-02-16 15:03:36 +0100
committerLibravatar GitHub <noreply@github.com>2018-02-16 15:03:36 +0100
commitd6662400e5f72822ce462f6c17f081db4ea4ac5f (patch)
tree59067a6cd261724607bc46ad1ac56210b23d1d5f /src/api/server/LocalApi.js
parentMerge branch 'fix/copy-paste' into develop (diff)
parentfix sideeffect of app not launching itself after first launch (diff)
downloadferdium-app-d6662400e5f72822ce462f6c17f081db4ea4ac5f.tar.gz
ferdium-app-d6662400e5f72822ce462f6c17f081db4ea4ac5f.tar.zst
ferdium-app-d6662400e5f72822ce462f6c17f081db4ea4ac5f.zip
fix(App): Fix issues with disabling launch app on startup
Refactor settingsStore to use mobx-localstorage
Diffstat (limited to 'src/api/server/LocalApi.js')
-rw-r--r--src/api/server/LocalApi.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/api/server/LocalApi.js b/src/api/server/LocalApi.js
index e95d750ac..aa3a7d655 100644
--- a/src/api/server/LocalApi.js
+++ b/src/api/server/LocalApi.js
@@ -6,38 +6,6 @@ import { getServicePartitionsDirectory } from '../../helpers/service-helpers.js'
6const { session } = remote; 6const { session } = remote;
7 7
8export default class LocalApi { 8export default class LocalApi {
9 // App
10 async updateAppSettings(data) {
11 const currentSettings = await this.getAppSettings();
12 const settings = Object.assign(currentSettings, data);
13
14 localStorage.setItem('app', JSON.stringify(settings));
15 console.debug('LocalApi::updateAppSettings resolves', settings);
16
17 return settings;
18 }
19
20 async getAppSettings() {
21 const settingsString = localStorage.getItem('app');
22 try {
23 const settings = JSON.parse(settingsString) || {};
24 console.debug('LocalApi::getAppSettings resolves', settings);
25
26 return settings;
27 } catch (err) {
28 return {};
29 }
30 }
31
32 async removeKey(key) {
33 const settings = await this.getAppSettings();
34
35 if (Object.hasOwnProperty.call(settings, key)) {
36 delete settings[key];
37 localStorage.setItem('app', JSON.stringify(settings));
38 }
39 }
40
41 // Services 9 // Services
42 async getAppCacheSize() { 10 async getAppCacheSize() {
43 const partitionsDir = getServicePartitionsDirectory(); 11 const partitionsDir = getServicePartitionsDirectory();