[fix] building errors 2/3

This commit is contained in:
2025-03-14 19:13:32 +08:00
parent d0872af38c
commit 8907160c3b
5 changed files with 79 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
"use client"
import { setTheme as setTauriTheme } from "@/hooks/tauri/theme"
import { resetAppStore } from "@/store/app"
import { resetToolStore } from "@/store/tool"
import { addToast } from "@heroui/react"
@@ -11,15 +12,18 @@ import {
Square,
SunOne,
} from "@icon-park/react"
import { getCurrentWindow } from "@tauri-apps/api/window"
import { type Theme, getCurrentWindow } from "@tauri-apps/api/window"
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 { saveAllNow } from "tauri-plugin-valtio"
const Nav = () => {
const { theme, setTheme } = useTheme()
const setAppTheme = async (theme: Theme) => {
setTheme(theme)
await setTauriTheme(theme)
}
const close = async () => {
// (await window.hideOnClose) ? getCurrent().hide() : exit();
@@ -79,7 +83,7 @@ const Nav = () => {
type="button"
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
onClick={() =>
theme === "light" ? setTheme("dark") : setTheme("light")
theme === "light" ? setAppTheme("dark") : setAppTheme("light")
}
>
{theme === "light" ? <SunOne size={16} /> : <Moon size={16} />}