diff --git a/webui/src/components/imageQueue.ts b/webui/src/components/imageQueue.ts index ca4ea1c..5acd30c 100644 --- a/webui/src/components/imageQueue.ts +++ b/webui/src/components/imageQueue.ts @@ -1,3 +1,4 @@ +import { local } from "d3"; import debug from "debug"; const dbg = debug("upend:imageQueue"); @@ -11,8 +12,11 @@ class ImageQueue { }[] = []; active = 0; + debugHalt: boolean; + constructor(concurrency: number) { this.concurrency = concurrency; + this.debugHalt = Boolean(localStorage.getItem("DEBUG:IMAGEHALT")); } public add( @@ -44,6 +48,10 @@ class ImageQueue { const next = this.queue.splice(nextIdx, 1)[0]; dbg(`Getting ${next.id}...`); this.active += 1; + next.element.classList.add("image-loading"); + if (this.debugHalt) { + return; + } next .callback() .then(() => { @@ -57,7 +65,6 @@ class ImageQueue { next.element.classList.remove("image-loading"); this.update(); }); - next.element.classList.add("image-loading"); } dbg(