From 412d857e735b2f103b36f43a31ad3dd2abce1a20 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sat, 22 Nov 2025 16:18:37 -0800 Subject: [PATCH] Minor code layout adjustment --- javascript/gallery.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index 1e70f09c3..28226a2b4 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -20,6 +20,10 @@ const el = { const SUPPORTED_EXTENSIONS = ['jpg', 'jpeg', 'png', 'webp', 'tiff', 'jp2', 'jxl', 'gif', 'mp4', 'mkv', 'avi', 'mjpeg', 'mpg', 'avr']; +async function awaitForIDB(num = 0) { + while (outstanding > num || idbIsCleaning) await new Promise((resolve) => setTimeout(resolve, 50)); +} + // HTML Elements class GalleryFolder extends HTMLElement { @@ -329,10 +333,6 @@ class GalleryFile extends HTMLElement { const gallerySendImage = (_images) => [currentImage]; // invoked by gradio button -async function awaitForIDB(num = 0) { - while (outstanding > num || idbIsCleaning) await new Promise((resolve) => setTimeout(resolve, 50)); -} - async function getHash(str, algo = 'SHA-256') { try { let hex = '';