From 0223cb12a4f886b8caa40be39e6a3adc71335dd4 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 23 Apr 2026 08:36:27 +0200 Subject: [PATCH] fix(hooks): Forward abort signal to fetchBansByCountry in useDashboardCountryData The useDashboardCountryData hook was creating an AbortController and checking signal.aborted in callbacks, but was not passing the signal to the fetchBansByCountry API call. This meant the HTTP request itself was never actually aborted. Now the signal is forwarded, allowing proper request cancellation when the hook unmounts or dependencies change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- frontend/src/hooks/useDashboardCountryData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/useDashboardCountryData.ts b/frontend/src/hooks/useDashboardCountryData.ts index 51730da..b4f8dbd 100644 --- a/frontend/src/hooks/useDashboardCountryData.ts +++ b/frontend/src/hooks/useDashboardCountryData.ts @@ -68,7 +68,7 @@ export function useDashboardCountryData( setLoading(true); setError(null); - fetchBansByCountry(timeRange, origin, source) + fetchBansByCountry(timeRange, origin, source, undefined, controller.signal) .then((data) => { if (controller.signal.aborted) return; setCountries(data.countries);