From 3c7a88e687fe5d9934c3cf599a6aae34145449bd Mon Sep 17 00:00:00 2001 From: Marton Lederer Date: Sun, 8 Jan 2023 13:01:55 +0100 Subject: [PATCH] fix: dispatch dependencies --- src/hooks/active_address.ts | 2 +- src/hooks/profile.ts | 2 +- src/modals/Profile.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/active_address.ts b/src/hooks/active_address.ts index d3cfff2..6e507ab 100644 --- a/src/hooks/active_address.ts +++ b/src/hooks/active_address.ts @@ -54,7 +54,7 @@ export async function useSyncAddress() { removeEventListener("focus", sync); }; })(); - }, [strategy]); + }, [strategy, dispatch]); } /** diff --git a/src/hooks/profile.ts b/src/hooks/profile.ts index 1fd14d9..e77a0f7 100644 --- a/src/hooks/profile.ts +++ b/src/hooks/profile.ts @@ -9,7 +9,7 @@ export default function useProfileModal() { useEffect(() => { if (state.activeStrategy || state.activeModal !== "profile") return; dispatch({ type: "CLOSE_MODAL" }); - }, [state]); + }, [state, dispatch]); return { setOpen(val: boolean) { diff --git a/src/modals/Profile.tsx b/src/modals/Profile.tsx index 027e38e..39a8d50 100644 --- a/src/modals/Profile.tsx +++ b/src/modals/Profile.tsx @@ -25,7 +25,7 @@ export function ProfileModal() { useEffect(() => { if (modalController.open) return; dispatch({ type: "CLOSE_MODAL" }); - }, [modalController.open]); + }, [modalController.open, dispatch]); function onClose() { dispatch({ type: "CLOSE_MODAL" });