diff --git a/src/components/cstb/Prepare.tsx b/src/components/cstb/Prepare.tsx index fe95df8..6f6013f 100644 --- a/src/components/cstb/Prepare.tsx +++ b/src/components/cstb/Prepare.tsx @@ -50,7 +50,7 @@ export function Prepare() { setCheckCount((prev) => (prev >= 10 ? 10 : prev + 1)) console.log(checkCount, "触发", debounceValid, steam.state.steamDir, steam.state.cs2Dir) - if (checkCount < 1) { + if (checkCount < 2) { if (debounceValid) { console.log("跳转") setTimeout(() => { diff --git a/src/components/window/SideBar.tsx b/src/components/window/SideBar.tsx index 4992e97..f6d37df 100644 --- a/src/components/window/SideBar.tsx +++ b/src/components/window/SideBar.tsx @@ -1,15 +1,9 @@ "use client" -import { Button, cn } from "@heroui/react" -import { - Home, - MonitorOne, - Movie, - Setting, - Terminal, - Toolkit, -} from "@icon-park/react" +import { cn } from "@heroui/react" +import { Home, MonitorOne, Movie, Setting, Terminal, Toolkit } from "@icon-park/react" import { usePathname, useRouter } from "next/navigation" import type { ReactNode } from "react" +import { getVersion } from "@tauri-apps/api/app" // import { platform } from "@tauri-apps/plugin-os" import { useAppStore } from "@/store/app" @@ -36,7 +30,7 @@ const SideButton = ({ className={cn( className, "p-2.5 hover:bg-black/5 rounded-lg transition relative", - path.startsWith(route) && "bg-black/5", + path.startsWith(route) && "bg-black/5" )} {...rest} > @@ -44,7 +38,7 @@ const SideButton = ({
@@ -60,7 +54,7 @@ const Avatar = () => { onClick={() => router.push("/users")} className={cn( "w-12 h-12 bg-gray-700 rounded-full shadow-2xl cursor-pointer transition active:scale-95 shadow-purple-800", - path.startsWith("/users") && "shadow-sm", + path.startsWith("/users") && "shadow-sm" )} type="button" > @@ -72,10 +66,14 @@ const Avatar = () => { const SideBar = () => { const app = useAppStore() + getVersion().then((Value) => { + app.setVersion(Value) + }) + return (
{ -
+

版本号

- +

{app.state.version}

)