mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): ensure CanvasObjectImage's visibility is set correctly when updating it
This commit is contained in:
@@ -95,22 +95,22 @@ export class CanvasObjectImage extends CanvasModuleBase {
|
||||
}
|
||||
|
||||
updateImageSource = async (imageName: string) => {
|
||||
this.log.trace({ imageName }, 'Updating image source');
|
||||
this.log.trace({ imageName }, 'Updating image source');
|
||||
|
||||
this.isLoading = true;
|
||||
this.konva.group.visible(true);
|
||||
this.isLoading = true;
|
||||
this.konva.group.visible(true);
|
||||
|
||||
if (!this.konva.image) {
|
||||
this.konva.placeholder.group.visible(false);
|
||||
this.konva.placeholder.text.text(t('common.loadingImage', 'Loading Image'));
|
||||
}
|
||||
if (!this.konva.image) {
|
||||
this.konva.placeholder.group.visible(false);
|
||||
this.konva.placeholder.text.text(t('common.loadingImage', 'Loading Image'));
|
||||
}
|
||||
|
||||
const imageDTO = await getImageDTOSafe(imageName);
|
||||
if (imageDTO === null) {
|
||||
const imageDTO = await getImageDTOSafe(imageName);
|
||||
if (imageDTO === null) {
|
||||
// ImageDTO not found (or network error)
|
||||
this.onFailedToLoadImage(t('controlLayers.unableToFindImage', 'Unable to find image'));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const imageElementResult = await withResultAsync(() => loadImage(imageDTO.image_url));
|
||||
if (imageElementResult.isErr()) {
|
||||
@@ -146,6 +146,7 @@ export class CanvasObjectImage extends CanvasModuleBase {
|
||||
image: this.imageElement,
|
||||
width,
|
||||
height,
|
||||
visible: true,
|
||||
});
|
||||
} else {
|
||||
this.log.trace('Creating new Konva image');
|
||||
|
||||
Reference in New Issue
Block a user