chore: fix lint error caused CI fail

This commit is contained in:
Simon
2026-06-15 22:59:34 +08:00
parent c04c02723d
commit 235fa1bc26
3 changed files with 7 additions and 5 deletions

View File

@@ -9,13 +9,15 @@ export function useGitHubStars() {
useEffect(() => {
if (cached !== null) return
fetch(STATS_URL)
const controller = new AbortController()
fetch(STATS_URL, { signal: controller.signal })
.then((r) => r.json())
.then((data) => {
cached = data.stargazers_count ?? null
setStars(cached)
})
.catch(() => {})
return () => controller.abort()
}, [])
return stars