diff options
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 7 |
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'; | |||
7 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | 7 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; |
8 | import AutoLaunch from 'auto-launch'; | 8 | import AutoLaunch from 'auto-launch'; |
9 | import prettyBytes from 'pretty-bytes'; | 9 | import prettyBytes from 'pretty-bytes'; |
10 | import ms from 'ms'; | ||
10 | 11 | ||
11 | import Store from './lib/Store'; | 12 | import Store from './lib/Store'; |
12 | import Request from './lib/Request'; | 13 | import 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 | } |