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>
This commit is contained in:
2026-04-23 08:36:27 +02:00
parent 5a6cb640d8
commit 0223cb12a4

View File

@@ -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);