From e43f03dbdef7d917dfbd49f851e57f8b3f892adc Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Tue, 26 May 2026 01:53:10 +0800 Subject: [PATCH] fix: resolve frontend CI type checks --- apps/desktop/src/composables/useWindowControls.ts | 2 +- apps/desktop/src/lib/tauri.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/composables/useWindowControls.ts b/apps/desktop/src/composables/useWindowControls.ts index aa1d6cd05b..94e311151e 100644 --- a/apps/desktop/src/composables/useWindowControls.ts +++ b/apps/desktop/src/composables/useWindowControls.ts @@ -2,7 +2,7 @@ import { ref, onMounted, onUnmounted } from "vue"; import { isTauriRuntime } from "@/lib/tauriRuntime"; import { isMacOS } from "@/lib/platform"; -export function shouldReserveMacTrafficLightInset(isMac: boolean, isFullscreen: boolean, isDesktop: boolean): boolean { +export function shouldReserveMacTrafficLightInset(isMac: boolean, isFullscreen: boolean, isDesktop = true): boolean { return isDesktop && isMac && !isFullscreen; } diff --git a/apps/desktop/src/lib/tauri.ts b/apps/desktop/src/lib/tauri.ts index 457efaa10c..1c5bffd347 100644 --- a/apps/desktop/src/lib/tauri.ts +++ b/apps/desktop/src/lib/tauri.ts @@ -694,7 +694,10 @@ export async function listJdbcDrivers(): Promise { return invoke("list_jdbc_drivers"); } -export async function importJdbcDrivers(paths: string[]): Promise { +export async function importJdbcDrivers(paths: (string | File)[]): Promise { + if (paths.some((path) => typeof path !== "string")) { + throw new Error("Desktop JDBC driver import requires local file paths"); + } return invoke("import_jdbc_drivers", { paths }); } @@ -710,7 +713,10 @@ export async function installJdbcPlugin(): Promise { return invoke("install_jdbc_plugin"); } -export async function installJdbcPluginLocal(path: string): Promise { +export async function installJdbcPluginLocal(path: string | File): Promise { + if (typeof path !== "string") { + throw new Error("Desktop JDBC plugin install requires a local file path"); + } return invoke("install_jdbc_plugin_local", { path }); } @@ -761,7 +767,10 @@ export async function importAgentsFromZip(path: string | File): Promise return invoke("import_agents_from_zip", { path }); } -export async function importAgentJar(dbType: string, path: string): Promise { +export async function importAgentJar(dbType: string, path: string | File): Promise { + if (typeof path !== "string") { + throw new Error("Desktop driver JAR import requires a local file path"); + } return invoke("import_agent_jar_cmd", { dbType, path }); }