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.
This commit is contained in:
jevb
2026-03-22 11:16:21 +01:00
parent 4c84ff6024
commit 09fca14422
@@ -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
});