diff options
Diffstat (limited to 'src/api/server/LocalApi.js')
-rw-r--r-- | src/api/server/LocalApi.js | 32 |
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' | |||
6 | const { session } = remote; | 6 | const { session } = remote; |
7 | 7 | ||
8 | export default class LocalApi { | 8 | export 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(); |