dev-prepare #2
@@ -36,7 +36,7 @@
|
|||||||
"error",
|
"error",
|
||||||
"always"
|
"always"
|
||||||
],
|
],
|
||||||
"react-hooks/exhaustive-deps": "error",
|
"react-hooks/exhaustive-deps": "warn",
|
||||||
"@typescript-eslint/no-misused-promises": [
|
"@typescript-eslint/no-misused-promises": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
},
|
},
|
||||||
"productName": "CS工具箱",
|
"productName": "CS工具箱",
|
||||||
"mainBinaryName": "cstb",
|
"mainBinaryName": "cstb",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"identifier": "upup.cool",
|
"identifier": "upup.cool",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"deep-link": {
|
"deep-link": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { steamStore, useSteamStore } from "@/store/steam"
|
import { useSteamStore } from "@/store/steam"
|
||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
import "./globals.css"
|
import "./globals.css"
|
||||||
import Providers from "./providers"
|
import Providers from "./providers"
|
||||||
@@ -16,10 +16,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|||||||
const debounceSteamDir = useDebounce(steam.state.steamDir, 500)
|
const debounceSteamDir = useDebounce(steam.state.steamDir, 500)
|
||||||
const debounceCs2Dir = useDebounce(steam.state.cs2Dir, 500)
|
const debounceCs2Dir = useDebounce(steam.state.cs2Dir, 500)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
steam.checkSteamDirValid()
|
void steam.checkSteamDirValid()
|
||||||
}, [debounceSteamDir])
|
}, [debounceSteamDir])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
steam.checkCs2DirValid()
|
void steam.checkCs2DirValid()
|
||||||
}, [debounceCs2Dir])
|
}, [debounceCs2Dir])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { addToast } from "@heroui/react"
|
import { addToast } from "@heroui/react"
|
||||||
import { FolderFocusOne } from "@icon-park/react"
|
import { FolderFocusOne } from "@icon-park/react"
|
||||||
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
||||||
import { open } from "@tauri-apps/plugin-fs"
|
|
||||||
|
|
||||||
interface RoundedButtonProps {
|
interface RoundedButtonProps {
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { addToast, Button, Chip, Spinner } from "@heroui/react"
|
import { addToast, Button, Chip, Spinner } from "@heroui/react"
|
||||||
import { useRouter } from "next/navigation"
|
import { useRouter } from "next/navigation"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { steamStore, useSteamStore } from "@/store/steam"
|
import { useSteamStore } from "@/store/steam"
|
||||||
import { open } from "@tauri-apps/plugin-dialog"
|
import { open } from "@tauri-apps/plugin-dialog"
|
||||||
import { invoke } from "@tauri-apps/api/core"
|
import { invoke } from "@tauri-apps/api/core"
|
||||||
import { onOpenUrl } from "@tauri-apps/plugin-deep-link"
|
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)
|
const [, setCs2Dir] = useState(steam.state.cs2Dir)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const initValues = async () => {
|
const initValues = () => {
|
||||||
const initialSteamDir = steam.state.steamDir
|
const initialSteamDir = steam.state.steamDir
|
||||||
const initialCs2Dir = steam.state.cs2Dir
|
const initialCs2Dir = steam.state.cs2Dir
|
||||||
|
|
||||||
@@ -54,7 +53,7 @@ export function Prepare() {
|
|||||||
setLoading(false)
|
setLoading(false)
|
||||||
}, 300)
|
}, 300)
|
||||||
}
|
}
|
||||||
void initValues()
|
initValues()
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleSelectSteamDir = async () => {
|
const handleSelectSteamDir = async () => {
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ import type { SteamUser } from "@/types/steam"
|
|||||||
import { store } from "@tauri-store/valtio"
|
import { store } from "@tauri-store/valtio"
|
||||||
import { DEFAULT_STORE_CONFIG } from "./config"
|
import { DEFAULT_STORE_CONFIG } from "./config"
|
||||||
import { useSnapshot } from "valtio"
|
import { useSnapshot } from "valtio"
|
||||||
import { useEffect } from "react"
|
|
||||||
import { addToast } from "@heroui/react"
|
|
||||||
import { invoke } from "@tauri-apps/api/core"
|
import { invoke } from "@tauri-apps/api/core"
|
||||||
import { dir } from "console"
|
|
||||||
|
|
||||||
const defaultValue = {
|
const defaultValue = {
|
||||||
steamDir: "C:\\Program Files (x86)\\Steam",
|
steamDir: "C:\\Program Files (x86)\\Steam",
|
||||||
|
|||||||
Reference in New Issue
Block a user