Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/routes/skills/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ export function SkillsIndex() {
}, [canLoadMore, hasQuery, isLoadingMore, loadMorePaginated])

useEffect(() => {
if (!canLoadMore || typeof IntersectionObserver === 'undefined') return
// Don't set up observer while loading to prevent infinite request loop
if (!canLoadMore || isLoadingMore || typeof IntersectionObserver === 'undefined') return
const target = loadMoreRef.current
if (!target) return
const observer = new IntersectionObserver(
Expand All @@ -218,7 +219,7 @@ export function SkillsIndex() {
)
observer.observe(target)
return () => observer.disconnect()
}, [canLoadMore, loadMore])
}, [canLoadMore, isLoadingMore, loadMore])

return (
<main className="section">
Expand Down