Parcourir la source

Merge pull request #2680 from overleaf/jpa-fix-cache-bust

[frontend] fix cache busting: add timestamp unless build id is present

GitOrigin-RevId: ece768cb33af47182b920c894636d686dba02c3b
Eric Mc Sween il y a 6 ans
Parent
commit
5527cab2a2

+ 2 - 2
services/web/frontend/js/ide/pdf/controllers/PdfController.js

@@ -455,7 +455,7 @@ define([
           )
         }
         // check if we need to bust cache (build id is unique so don't need it in that case)
-        if (fileByPath['output.pdf'] && fileByPath['output.pdf'].build) {
+        if (!(fileByPath['output.pdf'] && fileByPath['output.pdf'].build)) {
           qs.cache_bust = `${Date.now()}`
         }
         // convert the qs hash into a query string and append it
@@ -538,7 +538,7 @@ define([
           opts.url = `/project/${$scope.project_id}/output/${name}`
         }
         // check if we need to bust cache (build id is unique so don't need it in that case)
-        if (file && file.build) {
+        if (!(file && file.build)) {
           opts.params.cache_bust = `${Date.now()}`
         }
         opts.url = buildPdfDownloadUrl(options.pdfDownloadDomain, opts.url)