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: {
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,
})
))}