From 5f59c2ffe21a87308bb3580d81cd1affb95ec05f Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 29 Sep 2023 13:48:29 -0300 Subject: [PATCH] Don't perform fetch more than once. --- src/js/hooks/useWebService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/hooks/useWebService.ts b/src/js/hooks/useWebService.ts index 3d86eb6..a0972dc 100644 --- a/src/js/hooks/useWebService.ts +++ b/src/js/hooks/useWebService.ts @@ -22,7 +22,7 @@ export function useWebService(): [Maybe, Maybe] { .then(receive) .then((json) => setResponse(Response(json))) .catch((err) => setError(err)); - }); + }, []); return [response, error]; }