From 0472b33164aeeefeff17a129f27f84d8de7c51c7 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:47:28 +1000 Subject: [PATCH] fix(ui): fix duplicate `is_intermediate` query param when fetching images --- .../listenerMiddleware/listeners/boardIdSelected.ts | 8 ++++++-- .../listeners/imageCategoriesChanged.ts | 1 + .../features/gallery/components/ImageGalleryContent.tsx | 1 + invokeai/frontend/web/src/services/api/thunks/image.ts | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts index 160ea33a1f..1c96c5700d 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts @@ -54,7 +54,9 @@ export const addBoardIdSelectedListener = () => { filteredImages.length < board.image_count && filteredImages.length < IMAGES_PER_PAGE ) { - dispatch(receivedPageOfImages({ categories, board_id })); + dispatch( + receivedPageOfImages({ categories, board_id, is_intermediate: false }) + ); } }, }); @@ -97,7 +99,9 @@ export const addBoardIdSelected_changeSelectedImage_listener = () => { filteredImages.length < board.image_count && filteredImages.length < IMAGES_PER_PAGE ) { - dispatch(receivedPageOfImages({ categories, board_id })); + dispatch( + receivedPageOfImages({ categories, board_id, is_intermediate: false }) + ); } }, }); diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts index 747d8789da..25b7b7c11f 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageCategoriesChanged.ts @@ -20,6 +20,7 @@ export const addImageCategoriesChangedListener = () => { receivedPageOfImages({ categories: action.payload, board_id: state.boards.selectedBoardId, + is_intermediate: false, }) ); } diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx index 9cb5c25bfd..24a89604e1 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx @@ -168,6 +168,7 @@ const ImageGalleryContent = () => { receivedPageOfImages({ categories, board_id: selectedBoardId, + is_intermediate: false, }) ); }, [categories, dispatch, selectedBoardId]); diff --git a/invokeai/frontend/web/src/services/api/thunks/image.ts b/invokeai/frontend/web/src/services/api/thunks/image.ts index 65d470caaf..a897835986 100644 --- a/invokeai/frontend/web/src/services/api/thunks/image.ts +++ b/invokeai/frontend/web/src/services/api/thunks/image.ts @@ -256,7 +256,6 @@ export const imageUpdated = createAppAsyncThunk< export const IMAGES_PER_PAGE = 20; const DEFAULT_IMAGES_LISTED_ARG = { - isIntermediate: false, limit: IMAGES_PER_PAGE, };