diff options
author | 2018-03-27 21:25:56 +0200 | |
---|---|---|
committer | 2018-03-27 21:25:56 +0200 | |
commit | 8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d (patch) | |
tree | 9b853e0d343f4bf2f60625431275bdc2dd08e027 /src/api | |
parent | Move "locale" to user data (diff) | |
download | ferdium-app-8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d.tar.gz ferdium-app-8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d.tar.zst ferdium-app-8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d.zip |
Split settings into multiple stores; app specific settings are now stored in config file
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/LocalApi.js | 8 | ||||
-rw-r--r-- | src/api/server/LocalApi.js | 19 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/api/LocalApi.js b/src/api/LocalApi.js index 59d7d8fa2..741917104 100644 --- a/src/api/LocalApi.js +++ b/src/api/LocalApi.js | |||
@@ -4,6 +4,14 @@ export default class LocalApi { | |||
4 | this.local = local; | 4 | this.local = local; |
5 | } | 5 | } |
6 | 6 | ||
7 | getAppSettings() { | ||
8 | return this.local.getAppSettings(); | ||
9 | } | ||
10 | |||
11 | updateAppSettings(data) { | ||
12 | return this.local.updateAppSettings(data); | ||
13 | } | ||
14 | |||
7 | getAppCacheSize() { | 15 | getAppCacheSize() { |
8 | return this.local.getAppCacheSize(); | 16 | return this.local.getAppCacheSize(); |
9 | } | 17 | } |
diff --git a/src/api/server/LocalApi.js b/src/api/server/LocalApi.js index 4d2497c61..78deb7aa5 100644 --- a/src/api/server/LocalApi.js +++ b/src/api/server/LocalApi.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import { remote } from 'electron'; | 1 | import { ipcRenderer, remote } from 'electron'; |
2 | import du from 'du'; | 2 | import du from 'du'; |
3 | 3 | ||
4 | import { getServicePartitionsDirectory } from '../../helpers/service-helpers.js'; | 4 | import { getServicePartitionsDirectory } from '../../helpers/service-helpers.js'; |
@@ -8,6 +8,23 @@ const debug = require('debug')('LocalApi'); | |||
8 | const { session } = remote; | 8 | const { session } = remote; |
9 | 9 | ||
10 | export default class LocalApi { | 10 | export default class LocalApi { |
11 | // Settings | ||
12 | getAppSettings() { | ||
13 | return new Promise((resolve) => { | ||
14 | ipcRenderer.once('appSettings', (event, data) => { | ||
15 | debug('LocalApi::getAppSettings resolves', data); | ||
16 | resolve(data); | ||
17 | }); | ||
18 | |||
19 | ipcRenderer.send('getAppSettings'); | ||
20 | }); | ||
21 | } | ||
22 | |||
23 | async updateAppSettings(data) { | ||
24 | debug('LocalApi::updateAppSettings resolves', data); | ||
25 | ipcRenderer.send('updateAppSettings', data); | ||
26 | } | ||
27 | |||
11 | // Services | 28 | // Services |
12 | async getAppCacheSize() { | 29 | async getAppCacheSize() { |
13 | const partitionsDir = getServicePartitionsDirectory(); | 30 | const partitionsDir = getServicePartitionsDirectory(); |