fix neg pages

This commit is contained in:
Mary Hipp 2024-06-24 14:13:13 -04:00 committed by psychedelicious
parent 3a531a3c88
commit 66e25628c3

View File

@ -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]);