Reduce delayedInit to 3 seconds
This commit is contained in:
@@ -17,7 +17,6 @@ module.exports = {
|
||||
APP_VERSION: APP_VERSION,
|
||||
APP_WINDOW_TITLE: APP_NAME + ' (BETA)',
|
||||
|
||||
AUTO_UPDATE_CHECK_STARTUP_DELAY: 5 * 1000 /* 5 seconds */,
|
||||
AUTO_UPDATE_URL: 'https://webtorrent.io/desktop/update' +
|
||||
'?version=' + APP_VERSION + '&platform=' + process.platform,
|
||||
|
||||
@@ -27,6 +26,8 @@ module.exports = {
|
||||
CONFIG_POSTER_PATH: path.join(getConfigPath(), 'Posters'),
|
||||
CONFIG_TORRENT_PATH: path.join(getConfigPath(), 'Torrents'),
|
||||
|
||||
DELAYED_INIT: 3000 /* 3 seconds */,
|
||||
|
||||
GITHUB_URL: 'https://github.com/feross/webtorrent-desktop',
|
||||
GITHUB_URL_ISSUES: 'https://github.com/feross/webtorrent-desktop/issues',
|
||||
GITHUB_URL_RAW: 'https://raw.githubusercontent.com/feross/webtorrent-desktop/master',
|
||||
|
||||
@@ -54,7 +54,6 @@ function init () {
|
||||
|
||||
app.on('will-finish-launching', function () {
|
||||
crashReporter.init()
|
||||
autoUpdater.init()
|
||||
})
|
||||
|
||||
app.on('ready', function () {
|
||||
@@ -64,6 +63,12 @@ function init () {
|
||||
shortcuts.init()
|
||||
tray.init()
|
||||
handlers.install()
|
||||
|
||||
/*
|
||||
* We always check for updates on app startup. To keep app startup fast, we delay this
|
||||
* first check so it happens when there is less going on.
|
||||
*/
|
||||
setTimeout(delayedInit, config.DELAYED_INIT)
|
||||
})
|
||||
|
||||
app.on('ipcReady', function () {
|
||||
@@ -87,6 +92,10 @@ function init () {
|
||||
})
|
||||
}
|
||||
|
||||
function delayedInit () {
|
||||
autoUpdater.init()
|
||||
}
|
||||
|
||||
function onOpen (e, torrentId) {
|
||||
e.preventDefault()
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ function init () {
|
||||
resumeTorrents()
|
||||
|
||||
// Lazy-load other stuff, like the AppleTV module, later to keep startup fast
|
||||
window.setTimeout(delayedInit, 5000)
|
||||
window.setTimeout(delayedInit, config.DELAYED_INIT)
|
||||
|
||||
// The UI is built with virtual-dom, a minimalist library extracted from React
|
||||
// The concepts--one way data flow, a pure function that renders state to a
|
||||
|
||||
Reference in New Issue
Block a user