aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index d90f32744..168aa7e48 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -7,6 +7,7 @@ import key from 'keymaster';
7import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; 7import { getDoNotDisturb } from '@meetfranz/electron-notification-state';
8import AutoLaunch from 'auto-launch'; 8import AutoLaunch from 'auto-launch';
9import prettyBytes from 'pretty-bytes'; 9import prettyBytes from 'pretty-bytes';
10import ms from 'ms';
10 11
11import Store from './lib/Store'; 12import Store from './lib/Store';
12import Request from './lib/Request'; 13import Request from './lib/Request';
@@ -112,12 +113,12 @@ export default class AppStore extends Store {
112 // Check if system is muted 113 // Check if system is muted
113 // There are no events to subscribe so we need to poll everey 5s 114 // There are no events to subscribe so we need to poll everey 5s
114 this._systemDND(); 115 this._systemDND();
115 setInterval(() => this._systemDND(), 5000); 116 setInterval(() => this._systemDND(), ms('5s'));
116 117
117 // Check for updates once every 4 hours 118 // Check for updates once every 4 hours
118 setInterval(() => this._checkForUpdates(), CHECK_INTERVAL); 119 setInterval(() => this._checkForUpdates(), CHECK_INTERVAL);
119 // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) 120 // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues)
120 setTimeout(() => this._checkForUpdates(), 30000); 121 setTimeout(() => this._checkForUpdates(), ms('30s'));
121 ipcRenderer.on('autoUpdate', (event, data) => { 122 ipcRenderer.on('autoUpdate', (event, data) => {
122 if (data.available) { 123 if (data.available) {
123 this.updateStatus = this.updateStatusTypes.AVAILABLE; 124 this.updateStatus = this.updateStatusTypes.AVAILABLE;
@@ -316,7 +317,7 @@ export default class AppStore extends Store {
316 } else { 317 } else {
317 const deltaTime = moment().diff(this.timeOfflineStart); 318 const deltaTime = moment().diff(this.timeOfflineStart);
318 319
319 if (deltaTime > 30 * 60 * 1000) { 320 if (deltaTime > ms('30m')) {
320 this.actions.service.reloadAll(); 321 this.actions.service.reloadAll();
321 } 322 }
322 } 323 }