From 5126d756fe03b558250ce0189276daff81d2394d Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Tue, 7 Dec 2021 10:49:18 +0100 Subject: [PATCH] Merge pull request #6008 from overleaf/ae-clear-cache-file-list [web] Clear the list of downloadable files after clearing the compile cache GitOrigin-RevId: d1d655612e6705f77c283b06012f8b5c14ed8f7a --- .../frontend/js/shared/context/compile-context.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/services/web/frontend/js/shared/context/compile-context.js b/services/web/frontend/js/shared/context/compile-context.js index dac9be60c3..f4fe44d9a3 100644 --- a/services/web/frontend/js/shared/context/compile-context.js +++ b/services/web/frontend/js/shared/context/compile-context.js @@ -380,10 +380,17 @@ export function CompileProvider({ children }) { const clearCache = useCallback(() => { setClearingCache(true) - return compiler.clearCache().finally(() => { - setClearingCache(false) - }) - }, [compiler, setClearingCache]) + return compiler + .clearCache() + .then(() => { + setFileList(undefined) + setPdfDownloadUrl(undefined) + setPdfUrl(undefined) + }) + .finally(() => { + setClearingCache(false) + }) + }, [compiler, setPdfDownloadUrl, setPdfUrl]) // clear the cache then run a compile, triggered by a menu item const recompileFromScratch = useCallback(() => {