From b195250672acaf732860a51c7a36bd19718ea713 Mon Sep 17 00:00:00 2001 From: ayang <473033518@qq.com> Date: Mon, 11 Nov 2024 20:57:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E6=89=98=E7=9B=98=E4=BB=8D=E7=84=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=97=A7=E7=89=88=E6=9C=AC=E5=8F=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 7 +++++-- src/utils/store.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 48d704aa93..8bdbdb9d5f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,14 +11,17 @@ import { useSnapshot } from "valtio"; const { defaultAlgorithm, darkAlgorithm } = theme; const App = () => { - const { appearance, env } = useSnapshot(globalStore); + const { appearance } = useSnapshot(globalStore); const { restoreState } = useWindowState(); + const [ready, { toggle }] = useBoolean(); useMount(async () => { await restoreState(); await restoreStore(); + toggle(); + // 生成 antd 的颜色变量 generateColorVars(); @@ -94,7 +97,7 @@ const App = () => { }} > - {env.saveDataDir && } + {ready && } ); diff --git a/src/utils/store.ts b/src/utils/store.ts index f17a4b20e3..ce9650e8b6 100644 --- a/src/utils/store.ts +++ b/src/utils/store.ts @@ -48,5 +48,5 @@ export const restoreStore = async (backup = false) => { if (backup) return; - initStore(); + return initStore(); };