This commit is contained in:
2026-01-30 12:56:00 +08:00
parent 91f24cb462
commit dcbbda951e
89 changed files with 13486 additions and 72 deletions

12
web/src/lib/invoke.ts Normal file
View File

@@ -0,0 +1,12 @@
import {invoke} from "@tauri-apps/api/core";
import {toast} from "sonner";
export async function invokeCommand<R>(command: string, data?: Record<string, unknown>): Promise<R> {
try {
return await invoke<R>(command, data);
} catch (e) {
toast.error(e as unknown as string);
throw e;
}
}