[feat] better store operation
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
"use client"
|
||||
import { appStore } from "@/store/app"
|
||||
import { useSnapshot } from "valtio"
|
||||
import { useAppStore } from "@/store/app"
|
||||
|
||||
export default function Page() {
|
||||
void appStore.start()
|
||||
const app = useSnapshot(appStore.state)
|
||||
const app = useAppStore()
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-start gap-3 pt-2 pb-1">
|
||||
<p>版本号:{app.version}</p>
|
||||
<p>是否有更新:{app.hasUpdate ? "有" : "无"}</p>
|
||||
<p>初始化:{app.inited ? "是" : "否"}</p>
|
||||
<p>公告:{app.notice}</p>
|
||||
<p>是否使用镜像源:{app.useMirror ? "是" : "否"}</p>
|
||||
<p>版本号:{app.state.version}</p>
|
||||
<p>是否有更新:{app.state.hasUpdate ? "有" : "无"}</p>
|
||||
<p>初始化:{app.state.inited ? "是" : "否"}</p>
|
||||
<p>公告:{app.state.notice}</p>
|
||||
<p>是否使用镜像源:{app.state.useMirror ? "是" : "否"}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user