Browse Source

Fix race condition on offline page

Thibaut 11 years ago
parent
commit
8ec7c85dd4
1 changed files with 4 additions and 0 deletions
  1. 4 0
      assets/javascripts/views/content/offline_page.coffee

+ 4 - 0
assets/javascripts/views/content/offline_page.coffee

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