From a89d97a1f3070639f71d73bef5d569446e3ba44b Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:23:33 -0800 Subject: [PATCH] Simplify message clearing --- javascript/gallery.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index 54131386f..adec39527 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -998,7 +998,6 @@ async function thumbCacheCleanup(folder, imgCount, controller, force = false) { return; } const cb_clearMsg = showCleaningMsg(cleanupCount); - const tRun = Date.now(); // Doesn't need high resolution await idbFolderCleanup(staticGalleryHashes, folder, controller.signal) .then((delcount) => { const t1 = performance.now(); @@ -1012,10 +1011,7 @@ async function thumbCacheCleanup(folder, imgCount, controller, force = false) { } }) .finally(async () => { - // Ensure at least enough time to see that it's a message and not the UI breaking/flickering - await new Promise((resolve) => { - setTimeout(resolve, Math.min(1000, Math.max(1000 - (Date.now() - tRun), 0))); // Total display time of at least 1 second - }); + await new Promise((resolve) => { setTimeout(resolve, 1000); }); // Delay removal by 1 second to ensure at least minimum visibility cb_clearMsg(); }); },