From 8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 27 Mar 2018 21:25:56 +0200 Subject: Split settings into multiple stores; app specific settings are now stored in config file --- src/stores/AppStore.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/stores/AppStore.js') 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 { // Actions @action _notify({ title, options, notificationId, serviceId = null }) { - if (this.stores.settings.all.isAppMuted) return; + if (this.stores.settings.all.app.isAppMuted) return; const notification = new window.Notification(title, options); notification.onclick = (e) => { @@ -240,14 +240,15 @@ export default class AppStore extends Store { this.isSystemMuteOverridden = overrideSystemMute; this.actions.settings.update({ - settings: { + type: 'app', + data: { isAppMuted: isMuted, }, }); } @action _toggleMuteApp() { - this._muteApp({ isMuted: !this.stores.settings.all.isAppMuted }); + this._muteApp({ isMuted: !this.stores.settings.all.app.isAppMuted }); } @action async _clearAllCache() { @@ -331,8 +332,9 @@ export default class AppStore extends Store { // Helpers _appStartsCounter() { this.actions.settings.update({ - settings: { - appStarts: (this.stores.settings.all.appStarts || 0) + 1, + type: 'stats', + data: { + appStarts: (this.stores.settings.all.stats.appStarts || 0) + 1, }, }); } @@ -340,7 +342,8 @@ export default class AppStore extends Store { async _autoStart() { this.autoLaunchOnStart = await this._checkAutoStart(); - if (this.stores.settings.all.appStarts === 1) { + if (this.stores.settings.all.stats.appStarts === 1) { + debug('Set app to launch on start'); this.actions.app.launchOnStartup({ enable: true, }); @@ -353,7 +356,7 @@ export default class AppStore extends Store { _systemDND() { const dnd = getDoNotDisturb(); - if (dnd !== this.stores.settings.all.isAppMuted && !this.isSystemMuteOverridden) { + if (dnd !== this.stores.settings.all.app.isAppMuted && !this.isSystemMuteOverridden) { this.actions.app.muteApp({ isMuted: dnd, overrideSystemMute: false, -- cgit v1.2.3-70-g09d2