Commit 0859c7ff authored by Chunchi Che's avatar Chunchi Che

fix HintNotification.tsx

parent 2aa3893b
Pipeline #21407 passed with stages
in 18 minutes and 9 seconds
......@@ -11,12 +11,12 @@ const MsgWin = ygopro.StocGameMessage.MsgWin;
const NeosConfig = useConfig();
export const HintNotification = () => {
const hintState = matStore.hint;
const hintSnap = useSnapshot(matStore.hint);
const snap = useSnapshot(matStore);
const hintState = snap.hint;
const currentPhase = matStore.phase.currentPhase;
const waiting = matStore.waiting;
const result = matStore.result;
const currentPhase = snap.phase.currentPhase;
const waiting = snap.waiting;
const result = snap.result;
const navigate = useNavigate();
......@@ -30,7 +30,7 @@ export const HintNotification = () => {
placement: "bottom",
});
}
}, [hintSnap?.msg]);
}, [hintState.msg]);
useEffect(() => {
if (currentPhase) {
......
......@@ -19,7 +19,8 @@ const {
const Mora = () => {
const snapMora = useSnapshot(moraStore);
const snapMatInitInfo = useSnapshot(matStore.initInfo);
const snapMat = useSnapshot(matStore);
const meLife = snapMat.initInfo.me.life;
const selectHandAble = snapMora.selectHandAble;
const selectTpAble = snapMora.selectTpAble;
......@@ -42,10 +43,10 @@ const Mora = () => {
useEffect(() => {
// 若对局已经开始,自动跳转
if (snapMatInitInfo.me.life > 0) {
if (meLife > 0) {
navigate(`/duel/${player}/${passWd}/${ip}`);
}
}, [snapMatInitInfo.me]);
}, [meLife]);
useEffect(() => {
if (isAiMode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment