Fix infinite scroll trigger

This commit is contained in:
Sam Becker 2025-10-26 09:47:11 -05:00
parent 5591635a1e
commit 9570a98168

View File

@ -60,7 +60,7 @@ export default function InfinitePhotoScroll({
children: (props: { children: (props: {
key: string key: string
photos: Photo[] photos: Photo[]
onLastPhotoVisible: () => void onLastPhotoVisible?: () => void
revalidatePhoto?: RevalidatePhoto revalidatePhoto?: RevalidatePhoto
}) => ReactNode }) => ReactNode
} & PhotoSetCategory) { } & PhotoSetCategory) {
@ -183,7 +183,9 @@ export default function InfinitePhotoScroll({
children({ children({
key: `${cacheKey}-${index}`, key: `${cacheKey}-${index}`,
photos, photos,
onLastPhotoVisible: advance, onLastPhotoVisible: index === data.length - 1
? advance
: undefined,
revalidatePhoto, revalidatePhoto,
}) })
))} ))}