Minor performance optimization to speed up app boot

pull/605/head
Thibaut Courouble 8 years ago
parent 067fa9355e
commit d59d43e64b

@ -105,8 +105,10 @@
@trigger 'ready' @trigger 'ready'
@router.start() @router.start()
@hideLoading() @hideLoading()
setTimeout =>
@welcomeBack() unless @doc @welcomeBack() unless @doc
@removeEvent 'ready bootError' @removeEvent 'ready bootError'
, 50
return return
initDoc: (doc) -> initDoc: (doc) ->

@ -5,7 +5,7 @@ class app.UpdateChecker
$.on window, 'focus', @checkForUpdate $.on window, 'focus', @checkForUpdate
app.appCache.on 'updateready', @onUpdateReady if app.appCache app.appCache.on 'updateready', @onUpdateReady if app.appCache
@checkDocs() setTimeout @checkDocs, 0
check: -> check: ->
if app.appCache if app.appCache
@ -21,7 +21,7 @@ class app.UpdateChecker
new app.views.Notif 'UpdateReady', autoHide: null new app.views.Notif 'UpdateReady', autoHide: null
return return
checkDocs: -> checkDocs: =>
unless app.settings.get('manualUpdate') unless app.settings.get('manualUpdate')
app.docs.updateInBackground() app.docs.updateInBackground()
else else

@ -135,7 +135,8 @@ class app.views.Search extends app.View
afterRoute: (name, context) => afterRoute: (name, context) =>
@delay @searchUrl if context.hash @delay @searchUrl if context.hash
@autoFocus() @delay @autoFocus
return
extractHashValue: -> extractHashValue: ->
if (value = @getHashValue())? if (value = @getHashValue())?

Loading…
Cancel
Save