[feat] loading state using init watch
This commit is contained in:
@@ -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() {
|
||||
</section>
|
||||
|
||||
<section className="flex justify-center w-full gap-3 mt-6">
|
||||
<Button onPress={() => void autoGetPaths()} variant="ghost" color="default" size="sm">
|
||||
<Button
|
||||
onPress={() => void autoGetPaths()}
|
||||
variant="ghost"
|
||||
color="default"
|
||||
size="sm"
|
||||
className="w-24"
|
||||
>
|
||||
自动获取
|
||||
</Button>
|
||||
<Button
|
||||
@@ -166,7 +171,8 @@ export function Prepare() {
|
||||
variant="solid"
|
||||
color="primary"
|
||||
size="sm"
|
||||
isLoading={checking}
|
||||
className="w-24"
|
||||
isLoading={steam.state.steamDirChecking || steam.state.cs2DirChecking}
|
||||
isDisabled={!inited}
|
||||
>
|
||||
进入
|
||||
|
||||
Reference in New Issue
Block a user