[feat] better store operation

This commit is contained in:
2025-03-17 11:48:30 +08:00
parent 47dc77732f
commit db3cf9aef2
15 changed files with 169 additions and 127 deletions

View File

@@ -1,18 +1,16 @@
"use client"
import { currentUser, steamStore } from "@/store/steam"
import { useSnapshot } from "valtio"
import { useSteamStore } from "@/store/steam"
export default function Page() {
void steamStore.start()
const steam = useSnapshot(steamStore.state)
const steam = useSteamStore()
return (
<div className="flex flex-col items-start gap-3 pt-2 pb-1">
<p>Steam路径{steam.dir}</p>
<p>{steam.csDir}</p>
<p>Steam路径有效{steam.isDirValid ? "是" : "否"}</p>
<p>{steam.isCsDirValid ? "是" : "否"}</p>
<p>Steam账号{currentUser().accountName}</p>
<p>Steam路径{steam.state.dir}</p>
<p>{steam.state.csDir}</p>
<p>Steam路径有效{steam.state.isDirValid ? "是" : "否"}</p>
<p>{steam.state.isCsDirValid ? "是" : "否"}</p>
<p>Steam账号{steam.currentUser().accountName}</p>
</div>
)
}