From 9570a981682f20fa0e13c1765d2069dafb191437 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 26 Oct 2025 09:47:11 -0500 Subject: [PATCH] Fix infinite scroll trigger --- src/photo/InfinitePhotoScroll.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/photo/InfinitePhotoScroll.tsx b/src/photo/InfinitePhotoScroll.tsx index 21fa597b..8a892fda 100644 --- a/src/photo/InfinitePhotoScroll.tsx +++ b/src/photo/InfinitePhotoScroll.tsx @@ -60,7 +60,7 @@ export default function InfinitePhotoScroll({ children: (props: { key: string photos: Photo[] - onLastPhotoVisible: () => void + onLastPhotoVisible?: () => void revalidatePhoto?: RevalidatePhoto }) => ReactNode } & PhotoSetCategory) { @@ -183,7 +183,9 @@ export default function InfinitePhotoScroll({ children({ key: `${cacheKey}-${index}`, photos, - onLastPhotoVisible: advance, + onLastPhotoVisible: index === data.length - 1 + ? advance + : undefined, revalidatePhoto, }) ))}