From 09fca144226048df3bc2bb159ab94a9808f042ce Mon Sep 17 00:00:00 2001 From: jevb Date: Sun, 22 Mar 2026 11:16:21 +0100 Subject: [PATCH] fix: use Rust invoke for Open DevTools button The button was calling a nonexistent openDevtools() method on the JS WebviewWindow API. Use invoke("open_devtools") to call the registered Rust command instead. --- .../src/components/settings/AdvancedTab.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Client/tauri-client/src/components/settings/AdvancedTab.ts b/Client/tauri-client/src/components/settings/AdvancedTab.ts index cf29c723..2d45db72 100644 --- a/Client/tauri-client/src/components/settings/AdvancedTab.ts +++ b/Client/tauri-client/src/components/settings/AdvancedTab.ts @@ -61,14 +61,8 @@ export function buildAdvancedTab(signal: AbortSignal): HTMLDivElement { const devtoolsBtn = createElement("button", { class: "ac-btn" }, "Open DevTools"); devtoolsBtn.addEventListener("click", () => { - void import("@tauri-apps/api/webviewWindow") - .then((mod) => { - const wv = mod.getCurrentWebviewWindow(); - const wvAny = wv as unknown as { openDevtools?: () => void }; - if (typeof wvAny.openDevtools === "function") { - wvAny.openDevtools(); - } - }) + void import("@tauri-apps/api/core") + .then((mod) => mod.invoke("open_devtools")) .catch(() => { // DevTools not available in this build });