diff options
author | 2018-11-16 20:47:22 +0100 | |
---|---|---|
committer | 2018-11-16 20:47:22 +0100 | |
commit | 5c1aeaca015088272afa12ca76ebbdd78832ea60 (patch) | |
tree | eceec82c776e625e70cfa0fc025ae592450a4f71 /src | |
parent | Polishing & increasing contrast (diff) | |
download | ferdium-app-5c1aeaca015088272afa12ca76ebbdd78832ea60.tar.gz ferdium-app-5c1aeaca015088272afa12ca76ebbdd78832ea60.tar.zst ferdium-app-5c1aeaca015088272afa12ca76ebbdd78832ea60.zip |
use native electron.systemPreferences.isDarkMode()
Diffstat (limited to 'src')
-rw-r--r-- | src/stores/AppStore.js | 7 | ||||
-rw-r--r-- | src/stores/SettingsStore.js | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index e24160b4c..d1ed2596b 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -1,11 +1,10 @@ | |||
1 | import { remote, ipcRenderer, shell } from 'electron'; | 1 | import { remote, ipcRenderer, shell, systemPreferences } from 'electron'; |
2 | import { action, computed, observable } from 'mobx'; | 2 | import { action, computed, observable } from 'mobx'; |
3 | import moment from 'moment'; | 3 | import moment from 'moment'; |
4 | import key from 'keymaster'; | 4 | 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'; | ||
9 | 8 | ||
10 | import Store from './lib/Store'; | 9 | import Store from './lib/Store'; |
11 | import Request from './lib/Request'; | 10 | import Request from './lib/Request'; |
@@ -80,7 +79,7 @@ export default class AppStore extends Store { | |||
80 | ]); | 79 | ]); |
81 | } | 80 | } |
82 | 81 | ||
83 | async setup() { | 82 | setup() { |
84 | this._appStartsCounter(); | 83 | this._appStartsCounter(); |
85 | // Focus the active service | 84 | // Focus the active service |
86 | window.addEventListener('focus', this.actions.service.focusActiveService); | 85 | window.addEventListener('focus', this.actions.service.focusActiveService); |
@@ -163,7 +162,7 @@ export default class AppStore extends Store { | |||
163 | 162 | ||
164 | this._healthCheck(); | 163 | this._healthCheck(); |
165 | 164 | ||
166 | this.isSystemDarkModeEnabled = await isDarkMode(); | 165 | this.isSystemDarkModeEnabled = systemPreferences.isDarkMode(); |
167 | } | 166 | } |
168 | 167 | ||
169 | @computed get cacheSize() { | 168 | @computed get cacheSize() { |
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 019ec12bb..31165053d 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import { systemPreferences } from 'electron'; | ||
1 | import { action, computed, observable } from 'mobx'; | 2 | import { action, computed, observable } from 'mobx'; |
2 | import localStorage from 'mobx-localstorage'; | 3 | import localStorage from 'mobx-localstorage'; |
3 | import isDarkMode from '@adlk/mojave-isdarkmode'; | ||
4 | 4 | ||
5 | import Store from './lib/Store'; | 5 | import Store from './lib/Store'; |
6 | import SettingsModel from '../models/Settings'; | 6 | import SettingsModel from '../models/Settings'; |
@@ -111,7 +111,7 @@ export default class SettingsStore extends Store { | |||
111 | this.actions.settings.update({ | 111 | this.actions.settings.update({ |
112 | type: 'app', | 112 | type: 'app', |
113 | data: { | 113 | data: { |
114 | darkMode: await isDarkMode(), | 114 | darkMode: systemPreferences.isDarkMode(), |
115 | }, | 115 | }, |
116 | }); | 116 | }); |
117 | 117 | ||