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
This commit is contained in:
Miguel Serrano 2021-12-07 10:49:18 +01:00 committed by Copybot
parent cb6fc31225
commit 5126d756fe

View file

@ -380,10 +380,17 @@ export function CompileProvider({ children }) {
const clearCache = useCallback(() => {
setClearingCache(true)
return compiler.clearCache().finally(() => {
return compiler
.clearCache()
.then(() => {
setFileList(undefined)
setPdfDownloadUrl(undefined)
setPdfUrl(undefined)
})
.finally(() => {
setClearingCache(false)
})
}, [compiler, setClearingCache])
}, [compiler, setPdfDownloadUrl, setPdfUrl])
// clear the cache then run a compile, triggered by a menu item
const recompileFromScratch = useCallback(() => {