From 90c6492b9c93d1f26c53e191a7b49915c2b1eba4 Mon Sep 17 00:00:00 2001 From: Purp1e <47248616+Purple-CSGO@users.noreply.github.com> Date: Fri, 21 Mar 2025 02:52:09 +0800 Subject: [PATCH] [feat] loading state using init watch --- src/components/cstb/Prepare.tsx | 14 ++++++++++---- src/store/steam.ts | 24 ++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/components/cstb/Prepare.tsx b/src/components/cstb/Prepare.tsx index 2bdbca6..268a164 100644 --- a/src/components/cstb/Prepare.tsx +++ b/src/components/cstb/Prepare.tsx @@ -30,10 +30,9 @@ export function Prepare() { const steam = useSteamStore() const router = useRouter() const [loading, setLoading] = useState(true) - const [checking, setChecking] = useState(false) + const [inited, setInited] = useState(false) const [, setSteamDir] = useState(steam.state.steamDir) const [, setCs2Dir] = useState(steam.state.cs2Dir) - const [inited, setInited] = useState(false) useEffect(() => { const initValues = async () => { @@ -158,7 +157,13 @@ export function Prepare() {
-