From 538cad1aadfd9892eb23b622df1853f88b35d24a Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sat, 22 Nov 2025 15:15:41 -0800 Subject: [PATCH] Simplify init - Doesn't need advanced handling anymore because the overlay is now fully dynamic. --- javascript/gallery.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index 86f167c0f..88a21c1a8 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -7,7 +7,6 @@ let outstanding = 0; let lastSort = 0; let lastSortName = 'None'; let idbIsCleaning = false; -let cleaningOverlayIsReady = false; const galleryHashes = new Set(); // Store separator states for the session const separatorStates = new Map(); @@ -587,10 +586,6 @@ async function fetchFilesHT(evt) { } async function fetchFilesWS(evt) { // fetch file-by-file list over websockets - if (!cleaningOverlayIsReady) { - setOverlayAnimation() // Can't call during initGallery because it'll attach to the wrong component for some reason - .then(() => {cleaningOverlayIsReady = true}); - } if (idbIsCleaning) return; galleryHashes.clear(); // Only called here because fetchFilesHT isn't called directly el.files.innerHTML = ''; @@ -715,7 +710,7 @@ function showCleaningMsg() { return () => { parent.style.position = ""; cleaningOverlay.remove(); - } + } } async function thumbCacheCleanup() { @@ -757,6 +752,7 @@ async function initGallery() { // triggered on gradio change to monitor when ui error('initGallery', 'Missing gallery elements'); return; } + setOverlayAnimation(); el.search.addEventListener('input', gallerySearch); el.btnSend = gradioApp().getElementById('tab-gallery-send-image'); document.getElementById('tab-gallery-files').style.height = opts.logmonitor_show ? '75vh' : '85vh';