From bd921a8ec8d2b8e297989c3f8d63182ba2b79725 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Tue, 27 Jan 2026 10:58:03 +0200 Subject: [PATCH] fix: handle abort error in useGithubStars hook --- surfsense_web/hooks/use-github-stars.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/surfsense_web/hooks/use-github-stars.ts b/surfsense_web/hooks/use-github-stars.ts index a4d4f80fd..aa2bad1b9 100644 --- a/surfsense_web/hooks/use-github-stars.ts +++ b/surfsense_web/hooks/use-github-stars.ts @@ -25,6 +25,10 @@ export const useGithubStars = () => { setStars(data?.stargazers_count); } catch (err) { + // Ignore abort errors (expected on unmount) + if (err instanceof Error && err.name === "AbortError") { + return; + } if (err instanceof Error) { console.error("Error fetching stars:", err); setError(err.message); @@ -37,7 +41,7 @@ export const useGithubStars = () => { getStars(); return () => { - abortController.abort(); + abortController.abort("Component unmounted"); }; }, []);