[feat] push /home when all preparation is done at launch
This commit is contained in:
@@ -4,7 +4,7 @@ import { useEffect } from "react"
|
||||
import "./globals.css"
|
||||
import Providers from "./providers"
|
||||
import { init } from "@/store"
|
||||
import { useDebounce } from "@uidotdev/usehooks"
|
||||
import { useDebounce } from "ahooks"
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
useEffect(() => {
|
||||
@@ -13,8 +13,8 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
|
||||
// 检测steam路径和游戏路径是否有效
|
||||
const steam = useSteamStore()
|
||||
const debounceSteamDir = useDebounce(steam.state.steamDir, 500)
|
||||
const debounceCs2Dir = useDebounce(steam.state.cs2Dir, 500)
|
||||
const debounceSteamDir = useDebounce(steam.state.steamDir, {wait: 500, leading: true, trailing: true, maxWait: 2500})
|
||||
const debounceCs2Dir = useDebounce(steam.state.cs2Dir, {wait: 500, leading: true, trailing: true, maxWait: 2500})
|
||||
useEffect(() => {
|
||||
void steam.checkSteamDirValid()
|
||||
}, [debounceSteamDir])
|
||||
|
||||
Reference in New Issue
Block a user