Skip to content

Commit 79bbaa1

Browse files
MOL-438/MOL-459: missing code
1 parent 2a5e976 commit 79bbaa1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

application/src/hooks/use-mollie-connector/use-mollie-connector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,19 @@ const getMethods = async (targetUrl?: string) => {
7979

8080
export const usePaymentMethodsFetcher = (url: string | undefined) => {
8181
const [fetchedData, setFetchedData] = useState<CustomMethodObject[]>([]);
82+
const [fetchedDataLoading, setFetchedDataLoading] = useState<boolean>(true);
8283

8384
useEffect(() => {
8485
const fetchData = async () => {
8586
const data = (await getMethods(url)) ?? [];
8687
setFetchedData(data);
88+
setFetchedDataLoading(false);
8789
};
8890

8991
if (url) {
9092
fetchData();
9193
}
9294
}, [url]);
9395

94-
return fetchedData;
96+
return { fetchedData, fetchedDataLoading };
9597
};

0 commit comments

Comments
 (0)