Gallery widget selected index

This commit is contained in:
space-nuko
2023-05-05 21:21:56 -05:00
parent ad35826c7b
commit df4f2b2d57
7 changed files with 52 additions and 38 deletions

View File

@@ -96,11 +96,11 @@ export default class ComfyImageCacheNode extends ComfyGraphNode {
}
private setIndex(newIndex: number, force: boolean = false) {
console.debug("[ComfyImageCacheNode] setIndex", newIndex, force)
if (newIndex === this.properties.index && !force)
return;
console.debug("[ComfyImageCacheNode] setIndex", newIndex, force)
if (!this.properties.images || newIndex < 0 || newIndex >= this.properties.images.images.length) {
console.debug("[ComfyImageCacheNode] invalid indexes", newIndex, this.properties.images)
return