From edbe726d05faafbbcbf9e47ea3247a96494e6cb5 Mon Sep 17 00:00:00 2001 From: yawn <69970183+yawn-c111@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:55:15 +0900 Subject: [PATCH] fix: getHat to useCallback for hats 429 error --- pkgs/frontend/hooks/useHats.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/frontend/hooks/useHats.ts b/pkgs/frontend/hooks/useHats.ts index bce0a92..29f3677 100644 --- a/pkgs/frontend/hooks/useHats.ts +++ b/pkgs/frontend/hooks/useHats.ts @@ -221,7 +221,7 @@ export const useHats = () => { [getWearerInfo], ); - const getHat = async (hatId: string) => { + const getHat = useCallback(async (hatId: string) => { const hat = await hatsSubgraphClient.getHat({ chainId: currentChain.id, hatId: BigInt(hatId), @@ -241,7 +241,7 @@ export const useHats = () => { }); return hat; - }; + }, []); const getWorkspacesList = useCallback( async (params: { walletAddress: string }) => {