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(() => { const clearCache = useCallback(() => {
setClearingCache(true) setClearingCache(true)
return compiler.clearCache().finally(() => { return compiler
.clearCache()
.then(() => {
setFileList(undefined)
setPdfDownloadUrl(undefined)
setPdfUrl(undefined)
})
.finally(() => {
setClearingCache(false) setClearingCache(false)
}) })
}, [compiler, setClearingCache]) }, [compiler, setPdfDownloadUrl, setPdfUrl])
// clear the cache then run a compile, triggered by a menu item // clear the cache then run a compile, triggered by a menu item
const recompileFromScratch = useCallback(() => { const recompileFromScratch = useCallback(() => {