[feat] better store saving logic + more launch options

This commit is contained in:
Purp1e
2025-03-13 22:04:27 +08:00
parent 7195bad731
commit 0bd15a80cd
4 changed files with 22 additions and 12 deletions

View File

@@ -16,19 +16,19 @@ 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"
import { saveAllNow } from "tauri-plugin-valtio"
const Nav = () => {
const { theme, setTheme } = useTheme()
const close = async () => {
// (await window.hideOnClose) ? getCurrent().hide() : exit();
await saveAll()
await saveAllNow()
await exit()
}
const minimize = async () => {
await saveAll()
await saveAllNow()
await getCurrentWindow().minimize()
}