From 66e25628c3e7293244452cae1f8a34a175031a02 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 24 Jun 2024 14:13:13 -0400 Subject: [PATCH] fix neg pages --- .../web/src/features/gallery/hooks/useGalleryPagination.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/gallery/hooks/useGalleryPagination.ts b/invokeai/frontend/web/src/features/gallery/hooks/useGalleryPagination.ts index 550027e17c..0663e5e5bc 100644 --- a/invokeai/frontend/web/src/features/gallery/hooks/useGalleryPagination.ts +++ b/invokeai/frontend/web/src/features/gallery/hooks/useGalleryPagination.ts @@ -52,7 +52,7 @@ export const useGalleryPagination = (pageButtonsPerSide: number = 2) => { // handle when total/pages decrease and user is on high page number (ie bulk removing or deleting) useEffect(() => { - if (currentPage + 1 > pages) { + if (pages && currentPage + 1 > pages) { goToLast(); } }, [currentPage, pages, goToLast]);