aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/UIStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/UIStore.js')
-rw-r--r--src/stores/UIStore.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js
index b391bdcae..d37ebe4c7 100644
--- a/src/stores/UIStore.js
+++ b/src/stores/UIStore.js
@@ -1,6 +1,8 @@
1import { action, observable, computed } from 'mobx'; 1import { action, observable, computed } from 'mobx';
2 2
3import Store from './lib/Store'; 3import Store from './lib/Store';
4import * as themeDefault from '../theme/default';
5import * as themeDark from '../theme/dark';
4 6
5export default class UIStore extends Store { 7export default class UIStore extends Store {
6 @observable showServicesUpdatedInfoBar = false; 8 @observable showServicesUpdatedInfoBar = false;
@@ -20,13 +22,21 @@ export default class UIStore extends Store {
20 return (settings.app.isAppMuted && settings.app.showMessageBadgeWhenMuted) || !settings.isAppMuted; 22 return (settings.app.isAppMuted && settings.app.showMessageBadgeWhenMuted) || !settings.isAppMuted;
21 } 23 }
22 24
25 @computed get theme() {
26 if (this.stores.settings.all.app.darkMode) {
27 return Object.assign({}, themeDefault, themeDark);
28 }
29
30 return themeDefault;
31 }
32
23 // Actions 33 // Actions
24 @action _openSettings({ path = '/settings' }) { 34 @action _openSettings({ path = '/settings' }) {
25 const settingsPath = path !== '/settings' ? `/settings/${path}` : path; 35 const settingsPath = path !== '/settings' ? `/settings/${path}` : path;
26 this.stores.router.push(settingsPath); 36 this.stores.router.push(settingsPath);
27 } 37 }
28 38
29 @action _closeSettings(): void { 39 @action _closeSettings() {
30 this.stores.router.push('/'); 40 this.stores.router.push('/');
31 } 41 }
32 42