diff options
author | 2021-08-13 09:07:33 +0530 | |
---|---|---|
committer | 2021-08-13 07:32:56 +0000 | |
commit | b2eef1daaa41313257e3f439d4d5604314c9ae2c (patch) | |
tree | 5fc0d7ff2d9c94d783ad166307f9e550a34086a2 /src/stores | |
parent | chore: Replace old '@meetfranz/electron-notification-state' with 'macos-notif... (diff) | |
download | ferdium-app-b2eef1daaa41313257e3f439d4d5604314c9ae2c.tar.gz ferdium-app-b2eef1daaa41313257e3f439d4d5604314c9ae2c.tar.zst ferdium-app-b2eef1daaa41313257e3f439d4d5604314c9ae2c.zip |
fix(App): Fix app focus detection
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 180f01af6..72ddc2927 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -27,7 +27,6 @@ import { | |||
27 | ferdiLocale, | 27 | ferdiLocale, |
28 | } from '../environment'; | 28 | } from '../environment'; |
29 | import locales from '../i18n/translations'; | 29 | import locales from '../i18n/translations'; |
30 | import { onVisibilityChange } from '../helpers/visibility-helper'; | ||
31 | import { getLocale } from '../helpers/i18n-helpers'; | 30 | import { getLocale } from '../helpers/i18n-helpers'; |
32 | 31 | ||
33 | import { | 32 | import { |
@@ -221,10 +220,9 @@ export default class AppStore extends Store { | |||
221 | 220 | ||
222 | this.isSystemDarkModeEnabled = nativeTheme.shouldUseDarkColors; | 221 | this.isSystemDarkModeEnabled = nativeTheme.shouldUseDarkColors; |
223 | 222 | ||
224 | onVisibilityChange((isVisible) => { | 223 | ipcRenderer.on('isWindowFocused', (event, isFocused) => { |
225 | this.isFocused = isVisible; | 224 | debug('Setting is focused to', isFocused); |
226 | 225 | this.isFocused = isFocused; | |
227 | debug('Window is visible/focused', isVisible); | ||
228 | }); | 226 | }); |
229 | 227 | ||
230 | powerMonitor.on('suspend', () => { | 228 | powerMonitor.on('suspend', () => { |