[feat] better store operation
This commit is contained in:
@@ -12,8 +12,7 @@ import { usePathname, useRouter } from "next/navigation"
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
// import { platform } from "@tauri-apps/plugin-os"
|
||||
import { appStore, setVersion } from "@/store/app"
|
||||
import { useSnapshot } from "valtio"
|
||||
import { useAppStore } from "@/store/app"
|
||||
|
||||
interface SideButtonProps {
|
||||
route: string
|
||||
@@ -71,8 +70,7 @@ const Avatar = () => {
|
||||
}
|
||||
|
||||
const SideBar = () => {
|
||||
void appStore.start()
|
||||
const { version } = useSnapshot(appStore.state)
|
||||
const app = useAppStore()
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -119,9 +117,9 @@ const SideBar = () => {
|
||||
variant="light"
|
||||
size="sm"
|
||||
className="mt-0.5 text-zinc-600"
|
||||
onPress={() => setVersion("x.y.z")}
|
||||
onPress={() => app.setVersion("x.y.z")}
|
||||
>
|
||||
{version}
|
||||
{app.state.version}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user