Skip to content

Commit ccfc604

Browse files
committed
fix(website): add AbortController to GitHub API fetch and 404 meta description
- Hero GitHubStarButton: add AbortController to abort fetch on unmount, preventing potential state updates on unmounted components - not-found.tsx: add missing description metadata for SEO completeness https://claude.ai/code/session_01XAKeP67mR8sb1MxDPkYhxC
1 parent c231b7b commit ccfc604

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

website/src/app/not-found.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Link from 'next/link';
33

44
export const metadata: Metadata = {
55
title: '404 - Page Not Found',
6+
description: 'The page you are looking for does not exist. Return to the GoSQLX homepage.',
67
robots: { index: false, follow: false },
78
};
89

website/src/components/home/Hero.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ function GitHubStarButton() {
1212
const [stars, setStars] = useState<number | null>(null);
1313

1414
useEffect(() => {
15-
fetch('https://api.github.com/repos/ajitpratap0/GoSQLX')
15+
const controller = new AbortController();
16+
fetch('https://api.github.com/repos/ajitpratap0/GoSQLX', { signal: controller.signal })
1617
.then((r) => r.json())
1718
.then((d) => { if (typeof d.stargazers_count === 'number') setStars(d.stargazers_count); })
1819
.catch(() => {});
20+
return () => controller.abort();
1921
}, []);
2022

2123
return (

0 commit comments

Comments
 (0)