[feat] basic steam user parse
todo: steamid32 + avatar
This commit is contained in:
@@ -10,7 +10,7 @@ export default function Page() {
|
||||
<p>游戏路径:{steam.state.cs2Dir}</p>
|
||||
<p>Steam路径有效:{steam.state.steamDirValid ? "是" : "否"}</p>
|
||||
<p>游戏路径有效:{steam.state.cs2DirValid ? "是" : "否"}</p>
|
||||
<p>Steam账号:{steam.currentUser()?.accountName || " "}</p>
|
||||
<p>Steam账号:{steam.currentUser()?.account_name || " "}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -15,12 +15,18 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
const steam = useSteamStore()
|
||||
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})
|
||||
const debounceSteamDirValid = useDebounce(steam.state.steamDirValid, {wait: 500, leading: true, trailing: true, maxWait: 2500})
|
||||
useEffect(() => {
|
||||
void steam.checkSteamDirValid()
|
||||
}, [debounceSteamDir])
|
||||
useEffect(() => {
|
||||
void steam.checkCs2DirValid()
|
||||
}, [debounceCs2Dir])
|
||||
useEffect(() => {
|
||||
if (debounceSteamDirValid) {
|
||||
void steam.getUsers()
|
||||
}
|
||||
}, [debounceSteamDirValid])
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
|
||||
Reference in New Issue
Block a user