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