aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-11-24 20:36:09 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-11-24 20:36:09 +0100
commit217cb8cdba811b93394811c6d616267cdf838eee (patch)
tree3683490e8288dbd179d4d60a09247287191e3b65 /src/stores/AppStore.js
parentDelay app based on featureAPI settings (diff)
downloadferdium-app-217cb8cdba811b93394811c6d616267cdf838eee.tar.gz
ferdium-app-217cb8cdba811b93394811c6d616267cdf838eee.tar.zst
ferdium-app-217cb8cdba811b93394811c6d616267cdf838eee.zip
Add missing delayApp commit
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 9ad4cd531..3e8b18801 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -12,6 +12,7 @@ import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
12import { isMac, isLinux, isWindows } from '../environment'; 12import { isMac, isLinux, isWindows } from '../environment';
13import locales from '../i18n/translations'; 13import locales from '../i18n/translations';
14import { gaEvent } from '../lib/analytics'; 14import { gaEvent } from '../lib/analytics';
15import { onVisibilityChange } from '../helpers/visibility-helper';
15 16
16import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js'; 17import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js';
17 18
@@ -56,6 +57,8 @@ export default class AppStore extends Store {
56 57
57 @observable isFullScreen = mainWindow.isFullScreen(); 58 @observable isFullScreen = mainWindow.isFullScreen();
58 59
60 @observable isFocused = true;
61
59 constructor(...args) { 62 constructor(...args) {
60 super(...args); 63 super(...args);
61 64
@@ -163,6 +166,17 @@ export default class AppStore extends Store {
163 this._healthCheck(); 166 this._healthCheck();
164 167
165 this.isSystemDarkModeEnabled = systemPreferences.isDarkMode(); 168 this.isSystemDarkModeEnabled = systemPreferences.isDarkMode();
169
170 onVisibilityChange((isVisible) => {
171 this.isFocused = isVisible;
172 // debug('Last focus', moment().diff(this.timeLastFocusStart));
173
174 // if (isVisible) {
175 // this.timeLastFocusStart = moment();
176 // }
177
178 debug('Window is visible/focused', isVisible);
179 });
166 } 180 }
167 181
168 @computed get cacheSize() { 182 @computed get cacheSize() {