Skip to content

Commit

Permalink
security update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kualta committed Jun 28, 2024
1 parent 890f909 commit c4a41a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"next": "latest",
"postcss": "^8.4.31",
"tailwindcss": "^3.2.0",
"ws": ">=8.17.1",
"typescript": "5.1.6"
},
"ct3aMetadata": {
Expand All @@ -118,4 +119,4 @@
"trustedDependencies": [
"@vercel/speed-insights"
]
}
}
6 changes: 3 additions & 3 deletions src/components/InfiniteScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const InfiniteScroll = ({ initialData, initialCursor, endpoint }) => {
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);

const loadMorePosts = async () => {
const loadMorePosts = useCallback(async () => {
if (loading || !cursor) return;

setLoading(true);
Expand All @@ -33,7 +33,7 @@ export const InfiniteScroll = ({ initialData, initialCursor, endpoint }) => {
} finally {
setLoading(false);
}
};
}, [cursor, loading]);

useEffect(() => {
const handleScroll = () => {
Expand All @@ -49,7 +49,7 @@ export const InfiniteScroll = ({ initialData, initialCursor, endpoint }) => {

window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
}, [loadMorePosts]);

if (error) throw new Error(error);

Expand Down

0 comments on commit c4a41a7

Please sign in to comment.