From 5c230caef33378c4c0a896d2b55204a03cf74e84 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Wed, 28 Dec 2022 22:05:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E6=9F=90?= =?UTF-8?q?=E4=BA=9B=E6=97=B6=E5=80=99=E8=B7=B3=E8=BD=AC=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E8=BF=87=E6=97=B6=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/web/src/routes/Entry/GuestView.tsx | 2 +- client/web/src/routes/Entry/LoginView.tsx | 2 +- client/web/src/routes/Entry/utils.ts | 2 +- .../web/src/routes/Main/Content/Personal/Friends/FriendList.tsx | 2 +- client/web/src/routes/Main/Provider.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/web/src/routes/Entry/GuestView.tsx b/client/web/src/routes/Entry/GuestView.tsx index dcde9bf0..c02851e8 100644 --- a/client/web/src/routes/Entry/GuestView.tsx +++ b/client/web/src/routes/Entry/GuestView.tsx @@ -33,7 +33,7 @@ export const GuestView: React.FC = React.memo(() => { } else { navigate('/main'); } - }, [nickname, history, navRedirect]); + }, [nickname, navigate, navRedirect]); return (
diff --git a/client/web/src/routes/Entry/LoginView.tsx b/client/web/src/routes/Entry/LoginView.tsx index c22375de..cf98f216 100644 --- a/client/web/src/routes/Entry/LoginView.tsx +++ b/client/web/src/routes/Entry/LoginView.tsx @@ -69,7 +69,7 @@ export const LoginView: React.FC = React.memo(() => { } else { navigate('/main'); } - }, [email, password, history, navRedirect]); + }, [email, password, navRedirect, navigate]); const navToView = useNavToView(); diff --git a/client/web/src/routes/Entry/utils.ts b/client/web/src/routes/Entry/utils.ts index 4c282689..5713ab0e 100644 --- a/client/web/src/routes/Entry/utils.ts +++ b/client/web/src/routes/Entry/utils.ts @@ -16,7 +16,7 @@ export function useNavToView() { pathname, }); }, - [history] + [navigate, location] ); return navToView; diff --git a/client/web/src/routes/Main/Content/Personal/Friends/FriendList.tsx b/client/web/src/routes/Main/Content/Personal/Friends/FriendList.tsx index 6f63bc4e..3cf5d6cd 100644 --- a/client/web/src/routes/Main/Content/Personal/Friends/FriendList.tsx +++ b/client/web/src/routes/Main/Content/Personal/Friends/FriendList.tsx @@ -32,7 +32,7 @@ export const FriendList: React.FC<{ const converse = await createDMConverse([targetId]); navigate(`/main/personal/converse/${converse._id}`); }, - [history] + [navigate] ); const handleRemoveFriend = useCallback(async (targetId: string) => { diff --git a/client/web/src/routes/Main/Provider.tsx b/client/web/src/routes/Main/Provider.tsx index 8a01293f..1a559d85 100644 --- a/client/web/src/routes/Main/Provider.tsx +++ b/client/web/src/routes/Main/Provider.tsx @@ -53,7 +53,7 @@ function useAppState() { setupRedux(socket, store); return { store, socket }; - }, [history]); + }, []); const store = value?.store; const socket = value?.socket;