From 88b4510383de184cda3cdf0333ba4cbed23f293f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 26 Jul 2026 22:50:37 +0000 Subject: [PATCH] Fix persistent "1 extension edited" false positive on page load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rowEdits() compared the Name field's trimmed DOM value against the untrimmed model value — any device whose stored name has stray leading/trailing whitespace (e.g. from a manual pjsip.conf edit) permanently failed that comparison on every load, showing the unsaved-changes bar with nothing actually changed. Trim both sides. --- services/security-dashboard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/security-dashboard.sh b/services/security-dashboard.sh index 6798e36..6b76039 100644 --- a/services/security-dashboard.sh +++ b/services/security-dashboard.sh @@ -3220,7 +3220,7 @@ function rowEdits(tr) { const numsEl = tr.querySelector(".ext-numbers"); const msgEl = tr.querySelector(".ext-messaging"); const edits = {}; - if (nameEl && !nameEl.disabled && nameEl.value.trim() !== model.name) edits.name = nameEl.value.trim(); + if (nameEl && !nameEl.disabled && nameEl.value.trim() !== (model.name || "").trim()) edits.name = nameEl.value.trim(); if (mobileEl && mobileEl.checked !== (model.category === "mobile")) edits.category = mobileEl.checked ? "mobile" : "standard"; if (modeEl && modeEl.value !== model.restrict) edits.restrict = modeEl.value; if (numsEl && numsEl.value !== model.allowed_numbers) edits.allowed_numbers = numsEl.value;