diff options
author | 2018-11-16 20:40:11 +0100 | |
---|---|---|
committer | 2018-11-16 20:40:11 +0100 | |
commit | 9d2447cfd493da423ce8a42a421fa8075c359da7 (patch) | |
tree | 8b5c9c4fe339eb7a77696f9f4feba9078f04c02f /src | |
parent | Fix linting (diff) | |
download | ferdium-app-9d2447cfd493da423ce8a42a421fa8075c359da7.tar.gz ferdium-app-9d2447cfd493da423ce8a42a421fa8075c359da7.tar.zst ferdium-app-9d2447cfd493da423ce8a42a421fa8075c359da7.zip |
Add isSystemDarkModeEnabled to AppStore
Diffstat (limited to 'src')
-rw-r--r-- | src/containers/auth/AuthLayoutContainer.js | 1 | ||||
-rw-r--r-- | src/stores/AppStore.js | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index 62b589d2f..a0618e012 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js | |||
@@ -26,6 +26,7 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer | |||
26 | isAPIHealthy={!stores.app.healthCheckRequest.isError} | 26 | isAPIHealthy={!stores.app.healthCheckRequest.isError} |
27 | retryHealthCheck={actions.app.healthCheck} | 27 | retryHealthCheck={actions.app.healthCheck} |
28 | isHealthCheckLoading={stores.app.healthCheckRequest.isExecuting} | 28 | isHealthCheckLoading={stores.app.healthCheckRequest.isExecuting} |
29 | darkMode={stores.app.isSystemDarkModeEnabled} | ||
29 | > | 30 | > |
30 | {children} | 31 | {children} |
31 | </AuthLayout> | 32 | </AuthLayout> |
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 38edff1b4..e24160b4c 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -5,6 +5,7 @@ import key from 'keymaster'; | |||
5 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | 5 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; |
6 | import AutoLaunch from 'auto-launch'; | 6 | import AutoLaunch from 'auto-launch'; |
7 | import prettyBytes from 'pretty-bytes'; | 7 | import prettyBytes from 'pretty-bytes'; |
8 | import isDarkMode from '@adlk/mojave-isdarkmode'; | ||
8 | 9 | ||
9 | import Store from './lib/Store'; | 10 | import Store from './lib/Store'; |
10 | import Request from './lib/Request'; | 11 | import Request from './lib/Request'; |
@@ -50,6 +51,8 @@ export default class AppStore extends Store { | |||
50 | 51 | ||
51 | @observable isSystemMuteOverridden = false; | 52 | @observable isSystemMuteOverridden = false; |
52 | 53 | ||
54 | @observable isSystemDarkModeEnabled = false; | ||
55 | |||
53 | @observable isClearingAllCache = false; | 56 | @observable isClearingAllCache = false; |
54 | 57 | ||
55 | @observable isFullScreen = mainWindow.isFullScreen(); | 58 | @observable isFullScreen = mainWindow.isFullScreen(); |
@@ -77,7 +80,7 @@ export default class AppStore extends Store { | |||
77 | ]); | 80 | ]); |
78 | } | 81 | } |
79 | 82 | ||
80 | setup() { | 83 | async setup() { |
81 | this._appStartsCounter(); | 84 | this._appStartsCounter(); |
82 | // Focus the active service | 85 | // Focus the active service |
83 | window.addEventListener('focus', this.actions.service.focusActiveService); | 86 | window.addEventListener('focus', this.actions.service.focusActiveService); |
@@ -159,6 +162,8 @@ export default class AppStore extends Store { | |||
159 | this.locale = this._getDefaultLocale(); | 162 | this.locale = this._getDefaultLocale(); |
160 | 163 | ||
161 | this._healthCheck(); | 164 | this._healthCheck(); |
165 | |||
166 | this.isSystemDarkModeEnabled = await isDarkMode(); | ||
162 | } | 167 | } |
163 | 168 | ||
164 | @computed get cacheSize() { | 169 | @computed get cacheSize() { |