fix(ui): fix gallery bugs

This commit is contained in:
psychedelicious 2023-05-23 22:58:32 +10:00 committed by Kent Keirsey
parent 23d9d58c08
commit aeaf3737aa

View File

@ -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,
});