diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 3d97ffe..f7fc72c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -44,7 +44,7 @@ }, "productName": "CS工具箱", "mainBinaryName": "cstb", - "version": "0.0.6-beta.1", + "version": "0.0.6-beta.2", "identifier": "upup.cool", "plugins": { "deep-link": { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 5e27164..315ca32 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -5,7 +5,7 @@ import { toolStore, useToolStore } from "@/store/tool" import { addToast } from "@heroui/react" import { invoke } from "@tauri-apps/api/core" import { listen } from "@tauri-apps/api/event" -import { useDebounce, useDebounceEffect, useDebounceFn } from "ahooks" +import { useDebounce } from "ahooks" import { useEffect } from "react" import "./globals.css" import Providers from "./providers" diff --git a/src/components/cstb/VideoSetting.tsx b/src/components/cstb/VideoSetting.tsx index 94ae728..b2e62b4 100644 --- a/src/components/cstb/VideoSetting.tsx +++ b/src/components/cstb/VideoSetting.tsx @@ -6,6 +6,7 @@ import { addToast, NumberInput, Tab, Tabs, Tooltip } from "@heroui/react" import { motion } from "framer-motion" import { useToolStore, VideoSetting as VideoConfig, VideoSettingTemplate } from "@/store/tool" import { useSteamStore } from "@/store/steam" +import { useDebounce } from "ahooks" const VideoSetting = () => { const [hide, setHide] = useState(false) @@ -253,6 +254,17 @@ const VideoSetting = () => { void tool.getVideoConfig(steam.state.steamDir, steam.currentUser()?.steam_id32 || 0) }, []) + const debounceCurrentUserId = useDebounce(steam.currentUser()?.steam_id32, { + wait: 500, + leading: false, + trailing: true, + maxWait: 2500, + }) + useEffect(() => { + if (steam.state.steamDirValid && steam.currentUser()) + void tool.getVideoConfig(steam.state.steamDir, steam.currentUser()?.steam_id32 || 0) + }, [debounceCurrentUserId]) + return (