Commit 99eae70d authored by timel's avatar timel

fix: jump mora cause duel never starting

parent 26cf22d9
Pipeline #21381 failed with stages
in 2 minutes and 21 seconds
...@@ -19,7 +19,7 @@ import { ...@@ -19,7 +19,7 @@ import {
unSelectTpAble, unSelectTpAble,
} from "@/reducers/moraSlice"; } from "@/reducers/moraSlice";
import { store } from "@/store"; import { store } from "@/store";
import { moraStore } from "@/valtioStores"; import { moraStore, matStore } from "@/valtioStores";
const { const {
automation: { isAiMode, isAiFirst }, automation: { isAiMode, isAiFirst },
...@@ -36,7 +36,7 @@ const Mora = () => { ...@@ -36,7 +36,7 @@ const Mora = () => {
const selectHandAble = snapMora.selectHandAble; const selectHandAble = snapMora.selectHandAble;
const selectTpAble = snapMora.selectTpAble; const selectTpAble = snapMora.selectTpAble;
const duelHsStart = snapMora.duelStart; // const duelHsStart = snapMora.duelStart;
const navigate = useNavigate(); const navigate = useNavigate();
const { player, passWd, ip } = useParams<{ const { player, passWd, ip } = useParams<{
...@@ -58,10 +58,10 @@ const Mora = () => { ...@@ -58,10 +58,10 @@ const Mora = () => {
useEffect(() => { useEffect(() => {
// 若对局已经开始,自动跳转 // 若对局已经开始,自动跳转
if (duelHsStart) { if (!selectHandAble) {
navigate(`/duel/${player}/${passWd}/${ip}`); navigate(`/duel/${player}/${passWd}/${ip}`);
} }
}, [duelHsStart]); }, [selectHandAble]);
useEffect(() => { useEffect(() => {
if (isAiMode) { if (isAiMode) {
......
...@@ -8,6 +8,6 @@ export interface MoraState { ...@@ -8,6 +8,6 @@ export interface MoraState {
export const moraStore = proxy<MoraState>({ export const moraStore = proxy<MoraState>({
duelStart: false, duelStart: false,
selectHandAble: false, selectHandAble: true,
selectTpAble: false, selectTpAble: true,
}); });
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