From af4a1ea81056da984880f440712263f0a8d8d945 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 14 Oct 2026 18:38:12 -0400 Subject: [PATCH] Gear dialog: do not shadow window.location Co-Authored-By: Claude Fable 5.1 --- settings/ui/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings/ui/app.js b/settings/ui/app.js index 3ec9c56..a76c130 100644 --- a/settings/ui/app.js +++ b/settings/ui/app.js @@ -578,11 +578,11 @@ b.querySelector("#dcancel").onclick = closeDialog; b.querySelector("#dok").onclick = async () => { const name = b.querySelector("#gname").value.trim(), kind = b.querySelector("#gkind").value, address = b.querySelector("#gaddr").value.trim(); - const location = b.querySelector("#gloc").value.trim(), notes = b.querySelector("#gnotes").value.trim(), watch = b.querySelector("#gwatch").value, keyId = b.querySelector("#gkey").value; + const where = b.querySelector("#gloc").value.trim(), notes = b.querySelector("#gnotes").value.trim(), watch = b.querySelector("#gwatch").value, keyId = b.querySelector("#gkey").value; if (!name) return alertBox("A name, please."); if (watch === "ping" && !/^[\w.:-]+$/.test(address)) return alertBox("To ping it, give it an address."); if (!ensureDraft()) return; - try { const r = await post("/api/gear", { name, kind, address, location, notes }); state.draft = r.draft; } catch (e) { return alertBox(e.message); } + try { const r = await post("/api/gear", { name, kind, address, location: where, notes }); state.draft = r.draft; } catch (e) { return alertBox(e.message); } if (watch) { const d = state.draft.config; const chk = watch === "ping" ? { type: "ping", host: address, name: tagOf(name) } : { type: "conn", conn: watch.slice(5), fix: "restart-connection" };