[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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user