Fix race condition on offline page

pull/165/head
Thibaut 10 years ago
parent f0c1ec73b7
commit 8ec7c85dd4

@ -62,13 +62,17 @@ class app.views.OfflinePage extends app.View
return return
onInstallSuccess: (doc) -> onInstallSuccess: (doc) ->
return unless @activated
doc.getInstallStatus (status) => doc.getInstallStatus (status) =>
return unless @activated
@docEl(doc).outerHTML = @renderDoc(doc, status) @docEl(doc).outerHTML = @renderDoc(doc, status)
$.highlight @docEl(doc), className: '_highlight' $.highlight @docEl(doc), className: '_highlight'
@refreshLinks() @refreshLinks()
return
return return
onInstallError: (doc) -> onInstallError: (doc) ->
return unless @activated
el = @docEl(doc) el = @docEl(doc)
el.lastElementChild.textContent = 'Error' el.lastElementChild.textContent = 'Error'
return return

Loading…
Cancel
Save