summaryrefslogtreecommitdiffstats
path: root/src/api/server/LocalApi.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-02-19 11:50:11 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-02-19 11:50:11 +0100
commit857221ad84b31819d22bb4ce028dd8cb8d606f86 (patch)
treefecf60fe2e210197f3eac53e55ad44ac94d3ca3c /src/api/server/LocalApi.js
parentAutomatic i18n update (i18n.meetfranz.com) (diff)
parentfix(Linux): Fix window restore on notification click (@closingin) (diff)
downloadferdium-app-857221ad84b31819d22bb4ce028dd8cb8d606f86.tar.gz
ferdium-app-857221ad84b31819d22bb4ce028dd8cb8d606f86.tar.zst
ferdium-app-857221ad84b31819d22bb4ce028dd8cb8d606f86.zip
Merge branch 'develop' into i18n
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();