Reduce delayedInit to 3 seconds

This commit is contained in:
Feross Aboukhadijeh
2016-05-11 22:02:59 +02:00
parent f35eb73d50
commit ea1c66b3fc
3 changed files with 13 additions and 3 deletions

View File

@@ -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',

View File

@@ -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()

View File

@@ -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