diff --git a/application/src/hooks/use-mollie-connector/use-mollie-connector.ts b/application/src/hooks/use-mollie-connector/use-mollie-connector.ts index 55e542d..139083f 100644 --- a/application/src/hooks/use-mollie-connector/use-mollie-connector.ts +++ b/application/src/hooks/use-mollie-connector/use-mollie-connector.ts @@ -79,11 +79,13 @@ const getMethods = async (targetUrl?: string) => { export const usePaymentMethodsFetcher = (url: string | undefined) => { const [fetchedData, setFetchedData] = useState([]); + const [fetchedDataLoading, setFetchedDataLoading] = useState(true); useEffect(() => { const fetchData = async () => { const data = (await getMethods(url)) ?? []; setFetchedData(data); + setFetchedDataLoading(false); }; if (url) { @@ -91,5 +93,5 @@ export const usePaymentMethodsFetcher = (url: string | undefined) => { } }, [url]); - return fetchedData; + return { fetchedData, fetchedDataLoading }; };