Skip to content

Commit b75d08a

Browse files
fix(ui): ensure CanvasObjectImage's visibility is set correctly when updating it
1 parent 5f1a30e commit b75d08a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

invokeai/frontend/web/src/features/controlLayers/konva/CanvasObject/CanvasObjectImage.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,22 @@ export class CanvasObjectImage extends CanvasModuleBase {
9595
}
9696

9797
updateImageSource = async (imageName: string) => {
98-
this.log.trace({ imageName }, 'Updating image source');
98+
this.log.trace({ imageName }, 'Updating image source');
9999

100-
this.isLoading = true;
101-
this.konva.group.visible(true);
100+
this.isLoading = true;
101+
this.konva.group.visible(true);
102102

103-
if (!this.konva.image) {
104-
this.konva.placeholder.group.visible(false);
105-
this.konva.placeholder.text.text(t('common.loadingImage', 'Loading Image'));
106-
}
103+
if (!this.konva.image) {
104+
this.konva.placeholder.group.visible(false);
105+
this.konva.placeholder.text.text(t('common.loadingImage', 'Loading Image'));
106+
}
107107

108-
const imageDTO = await getImageDTOSafe(imageName);
109-
if (imageDTO === null) {
108+
const imageDTO = await getImageDTOSafe(imageName);
109+
if (imageDTO === null) {
110110
// ImageDTO not found (or network error)
111111
this.onFailedToLoadImage(t('controlLayers.unableToFindImage', 'Unable to find image'));
112-
return;
113-
}
112+
return;
113+
}
114114

115115
const imageElementResult = await withResultAsync(() => loadImage(imageDTO.image_url));
116116
if (imageElementResult.isErr()) {
@@ -146,6 +146,7 @@ export class CanvasObjectImage extends CanvasModuleBase {
146146
image: this.imageElement,
147147
width,
148148
height,
149+
visible: true,
149150
});
150151
} else {
151152
this.log.trace('Creating new Konva image');

0 commit comments

Comments
 (0)