diff options
author | 2018-03-27 21:25:56 +0200 | |
---|---|---|
committer | 2018-03-27 21:25:56 +0200 | |
commit | 8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d (patch) | |
tree | 9b853e0d343f4bf2f60625431275bdc2dd08e027 /src/stores/AppStore.js | |
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/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 94ed308f3..3c6c24b59 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -159,7 +159,7 @@ export default class AppStore extends Store { | |||
159 | 159 | ||
160 | // Actions | 160 | // Actions |
161 | @action _notify({ title, options, notificationId, serviceId = null }) { | 161 | @action _notify({ title, options, notificationId, serviceId = null }) { |
162 | if (this.stores.settings.all.isAppMuted) return; | 162 | if (this.stores.settings.all.app.isAppMuted) return; |
163 | 163 | ||
164 | const notification = new window.Notification(title, options); | 164 | const notification = new window.Notification(title, options); |
165 | notification.onclick = (e) => { | 165 | notification.onclick = (e) => { |
@@ -240,14 +240,15 @@ export default class AppStore extends Store { | |||
240 | this.isSystemMuteOverridden = overrideSystemMute; | 240 | this.isSystemMuteOverridden = overrideSystemMute; |
241 | 241 | ||
242 | this.actions.settings.update({ | 242 | this.actions.settings.update({ |
243 | settings: { | 243 | type: 'app', |
244 | data: { | ||
244 | isAppMuted: isMuted, | 245 | isAppMuted: isMuted, |
245 | }, | 246 | }, |
246 | }); | 247 | }); |
247 | } | 248 | } |
248 | 249 | ||
249 | @action _toggleMuteApp() { | 250 | @action _toggleMuteApp() { |
250 | this._muteApp({ isMuted: !this.stores.settings.all.isAppMuted }); | 251 | this._muteApp({ isMuted: !this.stores.settings.all.app.isAppMuted }); |
251 | } | 252 | } |
252 | 253 | ||
253 | @action async _clearAllCache() { | 254 | @action async _clearAllCache() { |
@@ -331,8 +332,9 @@ export default class AppStore extends Store { | |||
331 | // Helpers | 332 | // Helpers |
332 | _appStartsCounter() { | 333 | _appStartsCounter() { |
333 | this.actions.settings.update({ | 334 | this.actions.settings.update({ |
334 | settings: { | 335 | type: 'stats', |
335 | appStarts: (this.stores.settings.all.appStarts || 0) + 1, | 336 | data: { |
337 | appStarts: (this.stores.settings.all.stats.appStarts || 0) + 1, | ||
336 | }, | 338 | }, |
337 | }); | 339 | }); |
338 | } | 340 | } |
@@ -340,7 +342,8 @@ export default class AppStore extends Store { | |||
340 | async _autoStart() { | 342 | async _autoStart() { |
341 | this.autoLaunchOnStart = await this._checkAutoStart(); | 343 | this.autoLaunchOnStart = await this._checkAutoStart(); |
342 | 344 | ||
343 | if (this.stores.settings.all.appStarts === 1) { | 345 | if (this.stores.settings.all.stats.appStarts === 1) { |
346 | debug('Set app to launch on start'); | ||
344 | this.actions.app.launchOnStartup({ | 347 | this.actions.app.launchOnStartup({ |
345 | enable: true, | 348 | enable: true, |
346 | }); | 349 | }); |
@@ -353,7 +356,7 @@ export default class AppStore extends Store { | |||
353 | 356 | ||
354 | _systemDND() { | 357 | _systemDND() { |
355 | const dnd = getDoNotDisturb(); | 358 | const dnd = getDoNotDisturb(); |
356 | if (dnd !== this.stores.settings.all.isAppMuted && !this.isSystemMuteOverridden) { | 359 | if (dnd !== this.stores.settings.all.app.isAppMuted && !this.isSystemMuteOverridden) { |
357 | this.actions.app.muteApp({ | 360 | this.actions.app.muteApp({ |
358 | isMuted: dnd, | 361 | isMuted: dnd, |
359 | overrideSystemMute: false, | 362 | overrideSystemMute: false, |