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(() => {