[fix] store not saving due to dep, reset to default dir

note: changing path or start() in useEffect cause the issue
This commit is contained in:
Purp1e
2025-03-13 02:34:59 +08:00
parent 06e6c5c3eb
commit bfcf519894
6 changed files with 20 additions and 21 deletions

View File

@@ -16,24 +16,20 @@ import { /* relaunch, */ exit } from "@tauri-apps/plugin-process"
import { useTheme } from "next-themes"
// import { platform } from "@tauri-apps/plugin-os"
import { usePathname, useRouter } from "next/navigation"
import { saveAll } from "tauri-plugin-valtio"
const Nav = () => {
const { theme, setTheme } = useTheme()
const close = async () => {
// (await window.hideOnClose) ? getCurrent().hide() : exit();
await saveAll()
await exit()
}
const minimize = () => {
getCurrentWindow()
.minimize()
.then(() => {
console.log("minimized")
})
.catch((err: unknown) => {
console.error(err)
})
const minimize = async () => {
await saveAll()
await getCurrentWindow().minimize()
}
const toggleMaximize = async () => {