From aeaf3737aac2a8c1cb9e69999aac5d2c4e6ee4f2 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 23 May 2023 22:58:32 +1000 Subject: [PATCH] fix(ui): fix gallery bugs --- invokeai/frontend/web/src/services/thunks/gallery.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/services/thunks/gallery.ts b/invokeai/frontend/web/src/services/thunks/gallery.ts index 694d44db3e..01e8a986b2 100644 --- a/invokeai/frontend/web/src/services/thunks/gallery.ts +++ b/invokeai/frontend/web/src/services/thunks/gallery.ts @@ -8,10 +8,16 @@ const galleryLog = log.child({ namespace: 'gallery' }); export const receivedResultImagesPage = createAppAsyncThunk( 'results/receivedResultImagesPage', - async (_arg, { getState }) => { + async (_arg, { getState, rejectWithValue }) => { + const { page, pages, nextPage } = getState().results; + + if (nextPage === page) { + rejectWithValue([]); + } + const response = await ImagesService.listImagesWithMetadata({ imageType: 'results', - imageCategory: 'image', + imageCategory: 'general', page: getState().results.nextPage, perPage: IMAGES_PER_PAGE, }); @@ -27,7 +33,7 @@ export const receivedUploadImagesPage = createAppAsyncThunk( async (_arg, { getState }) => { const response = await ImagesService.listImagesWithMetadata({ imageType: 'uploads', - imageCategory: 'image', + imageCategory: 'general', page: getState().uploads.nextPage, perPage: IMAGES_PER_PAGE, });