From 9ae7c1a7c7454aa90e26f6376f463a84b49467c1 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:20:23 -0800 Subject: [PATCH] Generalize the SimpleFunctionQueue class --- javascript/gallery.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index 2f7cbf21a..c4f483b5e 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -70,8 +70,8 @@ function updateGalleryStyles() { // Classes +/* This isn't as robust as the Web Locks API, but it will at least work if accessing a remote machine without HTTPS */ class SimpleFunctionQueue { - /* This isn't as robust as the Web Locks API, but it will at least work if accessing a remote machine without HTTPS */ #id; #running; #queue; @@ -108,7 +108,11 @@ class SimpleFunctionQueue { return; } this.#running = true; - await callback(); + if (callback.constructor.name.lower() === 'asyncfunction') { + await callback(); + } else { + callback(); + } } catch (err) { error(`${this.#id} Queue:`, err); } finally {