From cfc3a20565810a72cb572019f1ad9ce99b4e1177 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Thu, 3 Aug 2023 15:47:59 -0400 Subject: [PATCH] autoAddBoardId should always be defined --- .../middleware/listenerMiddleware/listeners/imageUploaded.ts | 2 +- .../frontend/web/src/features/gallery/store/gallerySlice.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts index f488259eb7..6dc2d482a9 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts @@ -40,7 +40,7 @@ export const addImageUploadedFulfilledListener = () => { // default action - just upload and alert user if (postUploadAction?.type === 'TOAST') { const { toastOptions } = postUploadAction; - if (!autoAddBoardId) { + if (!autoAddBoardId || autoAddBoardId === 'none') { dispatch(addToast({ ...DEFAULT_UPLOADED_TOAST, ...toastOptions })); } else { // Add this image to the board diff --git a/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts b/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts index 3b0dd233f1..bc7acff6f4 100644 --- a/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts +++ b/invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts @@ -41,6 +41,10 @@ export const gallerySlice = createSlice({ state.galleryView = 'images'; }, autoAddBoardIdChanged: (state, action: PayloadAction) => { + if (!action.payload) { + state.autoAddBoardId = 'none'; + return; + } state.autoAddBoardId = action.payload; }, galleryViewChanged: (state, action: PayloadAction) => {