From a915bf450616e4f453b4a19ea95562c3801dd169 Mon Sep 17 00:00:00 2001 From: Purp1e <47248616+Purple-CSGO@users.noreply.github.com> Date: Fri, 21 Mar 2025 03:00:02 +0800 Subject: [PATCH] [fix[ building error and migrate to v0.0.3 --- .eslintrc.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/app/layout.tsx | 6 +++--- src/components/cstb/CommonDir.tsx | 1 - src/components/cstb/Prepare.tsx | 7 +++---- src/store/steam.ts | 3 --- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index dc8c474..257a674 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -36,7 +36,7 @@ "error", "always" ], - "react-hooks/exhaustive-deps": "error", + "react-hooks/exhaustive-deps": "warn", "@typescript-eslint/no-misused-promises": [ "error", { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9d762d3..1e30f4e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -42,7 +42,7 @@ }, "productName": "CS工具箱", "mainBinaryName": "cstb", - "version": "0.0.2", + "version": "0.0.3", "identifier": "upup.cool", "plugins": { "deep-link": { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 74853f9..80dda2e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,5 @@ "use client" -import { steamStore, useSteamStore } from "@/store/steam" +import { useSteamStore } from "@/store/steam" import { useEffect } from "react" import "./globals.css" import Providers from "./providers" @@ -16,10 +16,10 @@ export default function RootLayout({ children }: { children: React.ReactNode }) const debounceSteamDir = useDebounce(steam.state.steamDir, 500) const debounceCs2Dir = useDebounce(steam.state.cs2Dir, 500) useEffect(() => { - steam.checkSteamDirValid() + void steam.checkSteamDirValid() }, [debounceSteamDir]) useEffect(() => { - steam.checkCs2DirValid() + void steam.checkCs2DirValid() }, [debounceCs2Dir]) return ( diff --git a/src/components/cstb/CommonDir.tsx b/src/components/cstb/CommonDir.tsx index 3095eaa..0448981 100644 --- a/src/components/cstb/CommonDir.tsx +++ b/src/components/cstb/CommonDir.tsx @@ -1,7 +1,6 @@ import { addToast } from "@heroui/react" import { FolderFocusOne } from "@icon-park/react" import { Card, CardBody, CardHeader, CardIcon } from "../window/Card" -import { open } from "@tauri-apps/plugin-fs" interface RoundedButtonProps { children?: React.ReactNode diff --git a/src/components/cstb/Prepare.tsx b/src/components/cstb/Prepare.tsx index 268a164..641d634 100644 --- a/src/components/cstb/Prepare.tsx +++ b/src/components/cstb/Prepare.tsx @@ -1,11 +1,10 @@ import { addToast, Button, Chip, Spinner } from "@heroui/react" import { useRouter } from "next/navigation" import { useEffect, useState } from "react" -import { steamStore, useSteamStore } from "@/store/steam" +import { useSteamStore } from "@/store/steam" import { open } from "@tauri-apps/plugin-dialog" import { invoke } from "@tauri-apps/api/core" import { onOpenUrl } from "@tauri-apps/plugin-deep-link" -import path from "path" /** * 检查指定路径的有效性 @@ -35,7 +34,7 @@ export function Prepare() { const [, setCs2Dir] = useState(steam.state.cs2Dir) useEffect(() => { - const initValues = async () => { + const initValues = () => { const initialSteamDir = steam.state.steamDir const initialCs2Dir = steam.state.cs2Dir @@ -54,7 +53,7 @@ export function Prepare() { setLoading(false) }, 300) } - void initValues() + initValues() }) const handleSelectSteamDir = async () => { diff --git a/src/store/steam.ts b/src/store/steam.ts index 7c033a4..2dc9812 100644 --- a/src/store/steam.ts +++ b/src/store/steam.ts @@ -2,10 +2,7 @@ import type { SteamUser } from "@/types/steam" import { store } from "@tauri-store/valtio" import { DEFAULT_STORE_CONFIG } from "./config" import { useSnapshot } from "valtio" -import { useEffect } from "react" -import { addToast } from "@heroui/react" import { invoke } from "@tauri-apps/api/core" -import { dir } from "console" const defaultValue = { steamDir: "C:\\Program Files (x86)\\Steam",