fix(ui): excessive toasts when generating on canvas

- Add `withToast` flag to `uploadImage` util
- Skip the toast if this is not set
- Use the flag to disable toasts when canvas does internal image-uploading stuff that should be invisible to user
This commit is contained in:
psychedelicious
2024-11-08 08:54:36 +10:00
parent a9db2ffefd
commit 75acece1f1
4 changed files with 48 additions and 20 deletions

View File

@@ -302,6 +302,7 @@ export class CanvasCompositorModule extends CanvasModuleBase {
is_intermediate: uploadOptions.is_intermediate,
board_id: uploadOptions.is_intermediate ? undefined : selectAutoAddBoardId(this.manager.store.getState()),
metadata: uploadOptions.metadata,
withToast: false,
})
);
this.$isUploading.set(false);

View File

@@ -493,6 +493,7 @@ export class CanvasEntityObjectRenderer extends CanvasModuleBase {
file: new File([blob], `${this.id}_rasterized.png`, { type: 'image/png' }),
image_category: 'other',
is_intermediate: true,
withToast: false,
});
const imageObject = imageDTOToImageObject(imageDTO);
if (replaceObjects) {