Skip to content

Commit 5c230ca

Browse files
committed
fix: 修复在某些时候跳转引用过时导致无法跳转的bug
1 parent a202419 commit 5c230ca

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

client/web/src/routes/Entry/GuestView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const GuestView: React.FC = React.memo(() => {
3333
} else {
3434
navigate('/main');
3535
}
36-
}, [nickname, history, navRedirect]);
36+
}, [nickname, navigate, navRedirect]);
3737

3838
return (
3939
<div className="w-96 text-white">

client/web/src/routes/Entry/LoginView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const LoginView: React.FC = React.memo(() => {
6969
} else {
7070
navigate('/main');
7171
}
72-
}, [email, password, history, navRedirect]);
72+
}, [email, password, navRedirect, navigate]);
7373

7474
const navToView = useNavToView();
7575

client/web/src/routes/Entry/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function useNavToView() {
1616
pathname,
1717
});
1818
},
19-
[history]
19+
[navigate, location]
2020
);
2121

2222
return navToView;

client/web/src/routes/Main/Content/Personal/Friends/FriendList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const FriendList: React.FC<{
3232
const converse = await createDMConverse([targetId]);
3333
navigate(`/main/personal/converse/${converse._id}`);
3434
},
35-
[history]
35+
[navigate]
3636
);
3737

3838
const handleRemoveFriend = useCallback(async (targetId: string) => {

client/web/src/routes/Main/Provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function useAppState() {
5353
setupRedux(socket, store);
5454

5555
return { store, socket };
56-
}, [history]);
56+
}, []);
5757

5858
const store = value?.store;
5959
const socket = value?.socket;

0 commit comments

Comments
 (0)