mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
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:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user