From 9e9e1e223695fd4daba418083f98367d3da790fa Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Wed, 28 Jan 2026 20:51:58 -0800 Subject: [PATCH] Minor updates - Update post-cleanup behavior for `thumbCacheCleanup` - Add timing info to `clearCacheIfDisabled` log - Improve visibility of cleanup message during cache clear --- javascript/gallery.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); }); },