Commit e1115001 authored by timel's avatar timel Committed by Chunchi Che

fix: store in devtool, compile error

parent 0c1920d6
...@@ -6,8 +6,7 @@ import { subscribeKey } from "valtio/utils"; ...@@ -6,8 +6,7 @@ import { subscribeKey } from "valtio/utils";
import { fetchCard, ygopro } from "@/api"; import { fetchCard, ygopro } from "@/api";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { sleep } from "@/infra"; import { sleep } from "@/infra";
import { cardStore, CardType, store } from "@/stores"; import { cardStore, CardType, matStore } from "@/stores";
const { matStore } = store;
const TOKEN_SIZE = 13; // 每人场上最多就只可能有13个token const TOKEN_SIZE = 13; // 每人场上最多就只可能有13个token
export default async (start: ygopro.StocGameMessage.MsgStart) => { export default async (start: ygopro.StocGameMessage.MsgStart) => {
......
...@@ -30,7 +30,7 @@ import { DeckManager, fetchDeck, type IDeck } from "@/api/deck"; ...@@ -30,7 +30,7 @@ import { DeckManager, fetchDeck, type IDeck } from "@/api/deck";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import socketMiddleWare, { socketCmd } from "@/middleware/socket"; import socketMiddleWare, { socketCmd } from "@/middleware/socket";
import sqliteMiddleWare, { sqliteCmd } from "@/middleware/sqlite"; import sqliteMiddleWare, { sqliteCmd } from "@/middleware/sqlite";
import { store } from "@/stores"; import { joinStore, chatStore, moraStore, playerStore } from "@/stores";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
...@@ -42,8 +42,11 @@ const { ...@@ -42,8 +42,11 @@ const {
} = useConfig(); } = useConfig();
const WaitRoom = () => { const WaitRoom = () => {
const state = store; const snapJoin = useSnapshot(joinStore);
const snap = useSnapshot(state); const snapChat = useSnapshot(chatStore);
const snapMora = useSnapshot(moraStore);
const snapPlayer = useSnapshot(playerStore);
const params = useParams<{ const params = useParams<{
player?: string; player?: string;
passWd?: string; passWd?: string;
...@@ -89,12 +92,12 @@ const WaitRoom = () => { ...@@ -89,12 +92,12 @@ const WaitRoom = () => {
const [api, contextHolder] = notification.useNotification(); const [api, contextHolder] = notification.useNotification();
const joined = snap.joinStore.value; const joined = snapJoin.value;
const chat = snap.chatStore.message; const chat = snapChat.message;
const isHost = snap.playerStore.isHost; const isHost = snapPlayer.isHost;
const player0 = snap.playerStore.player0; const player0 = snapPlayer.player0;
const player1 = snap.playerStore.player1; const player1 = snapPlayer.player1;
const duelStart = snap.moraStore.duelStart; const duelStart = snapMora.duelStart;
// FIXME: 这些数据应该从`store`中获取 // FIXME: 这些数据应该从`store`中获取
// TODO: 云卡组 // TODO: 云卡组
......
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