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 = '';