diff --git a/javascript/gallery.js b/javascript/gallery.js index 0c5991d16..d10e4974c 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -1004,6 +1004,9 @@ async function thumbCacheCleanup(folder, imgCount, controller, force = false) { .then((delcount) => { const t1 = performance.now(); log(`Thumbnail DB cleanup: folder=${folder} kept=${staticGalleryHashes.size} deleted=${delcount} time=${Math.floor(t1 - t0)}ms`); + currentGalleryFolder = null; + el.clearCacheFolder.innerText = ''; updateStatusWithSort('Thumbnail cache cleared'); - log('Thumbnail DB cleanup: Cache cleared'); }) .catch((e) => { SimpleFunctionQueue.abortLogger('Thumbnail DB cleanup:', e); }) - .finally(() => { + .finally(async () => { + await new Promise((resolve) => { setTimeout(resolve, 1000); }); cb_clearMsg(); }); },