MCPcopy
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / updateWithNewImage

Method updateWithNewImage

web/js/common/lightbox.js:118–126  ·  view source on GitHub ↗
(img, feedDirection)

Source from the content-addressed store, hash-verified

116 }
117
118 async updateWithNewImage(img, feedDirection) {
119 // No-op if lightbox is not open
120 if (this.el.style.display === "none" || this.el.style.opacity === "0") return;
121
122 // Ensure currently shown image does not change
123 const [method, shift] = feedDirection === "newest first" ? ["unshift", 1] : ["push", 0];
124 this.images[method](img);
125 await this.update(shift);
126 }
127}
128
129export const lightbox = new Lightbox();

Callers 1

addImageToFeedFunction · 0.80

Calls 1

updateMethod · 0.95

Tested by

no test coverage detected