Sfoglia il codice sorgente

Fix race condition on offline page

Thibaut 11 anni fa
parent
commit
8ec7c85dd4
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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