From 75d6b65119e11f340e2d840c2bc59bde85177b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 5 Aug 2026 17:02:41 +0000 Subject: [PATCH] headscale: key the server form to the server it edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit editing one server then another without closing in between reused the same mounted form, which seeds its fields at mount — so the second server showed the first one's name, url and ssh host. submit diffs that stale state against the new server prop, so saving would have written them to it. --- .../officerdev/src/apps/Headscale/ServersView.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/workspaces/officerdev/src/apps/Headscale/ServersView.tsx b/src/workspaces/officerdev/src/apps/Headscale/ServersView.tsx index 4ea0c3b4..50c9e99e 100644 --- a/src/workspaces/officerdev/src/apps/Headscale/ServersView.tsx +++ b/src/workspaces/officerdev/src/apps/Headscale/ServersView.tsx @@ -221,7 +221,16 @@ export const ServersView = () => { } /> - {formFor && setFormFor(null)} />} + {/* Keyed by which server it edits: the form seeds its fields from the prop once, at mount, so + switching straight from one server's Edit to another's would otherwise keep the first one's + values — and submit diffs those stale values against the NEW server, writing them to it. */} + {formFor && ( + setFormFor(null)} + /> + )} {actionError && {actionError}}