diff --git a/invokeai/frontend/web/src/services/thunks/gallery.ts b/invokeai/frontend/web/src/services/thunks/gallery.ts index 85e60326a4..9e7ee6d5c6 100644 --- a/invokeai/frontend/web/src/services/thunks/gallery.ts +++ b/invokeai/frontend/web/src/services/thunks/gallery.ts @@ -11,6 +11,8 @@ export const receivedResultImagesPage = createAppAsyncThunk( async (_arg, { getState, rejectWithValue }) => { const { page, pages, nextPage, upsertedImageCount } = getState().results; + // If many images have been upserted, we need to offset the page number + // TODO: add an offset param to the list images endpoint const pageOffset = Math.floor(upsertedImageCount / IMAGES_PER_PAGE); const response = await ImagesService.listImagesWithMetadata({ @@ -31,6 +33,8 @@ export const receivedUploadImagesPage = createAppAsyncThunk( async (_arg, { getState, rejectWithValue }) => { const { page, pages, nextPage, upsertedImageCount } = getState().uploads; + // If many images have been upserted, we need to offset the page number + // TODO: add an offset param to the list images endpoint const pageOffset = Math.floor(upsertedImageCount / IMAGES_PER_PAGE); const response = await ImagesService.listImagesWithMetadata({