From 3331d567c0980ade6d5a04eea642ce034659e9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Sun, 31 May 2026 13:52:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8F=90=E5=8F=96=20refreshBoard?= =?UTF-8?q?=20status=20=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=E6=8F=90?= =?UTF-8?q?=E9=AB=98=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cargo/config.toml | 3 ++- src/store/gameStore.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 027962f..d8ec548 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,4 @@ +# MinGW-Builds MCF 线程模型运行时需要显式链接 libmcfgthread。 +# 如果使用 MSVC 工具链或 POSIX 线程模型的 MinGW,可移除此配置。 [target.x86_64-pc-windows-gnu] -# MinGW-Builds MCF 运行时需要链接 libmcfgthread rustflags = ["-C", "link-args=-lmcfgthread"] diff --git a/src/store/gameStore.ts b/src/store/gameStore.ts index a285351..f65491a 100644 --- a/src/store/gameStore.ts +++ b/src/store/gameStore.ts @@ -100,10 +100,15 @@ export const useGameStore = create((set, get) => ({ refreshBoard: async () => { const state: { board: CellState[][]; current_color: string; game_over: boolean } = await invoke('get_game_state'); + const newStatus: GameStatus = state.game_over + ? 'game_over' + : get().status === 'ai_thinking' + ? 'ai_thinking' + : 'playing'; set({ board: state.board, currentColor: state.current_color as Color, - status: state.game_over ? 'game_over' : get().status === 'ai_thinking' ? 'ai_thinking' : 'playing', + status: newStatus, }); },