fix(mcp_servers): only consume openUserFields deep-link param once target is matched

Previously the param was stripped from the URL on the first effect run even when
the target server was not yet present in serversWithHealth, so a later re-render
with the populated list could not re-open the modal. Move the URL cleanup back
inside the matched-target branch so the deep link is consumed exactly when the
modal is opened.
This commit is contained in:
mateo-berri 2026-05-19 06:50:52 +00:00
parent 5403fbbbb1
commit 366be211c1
No known key found for this signature in database

View file

@ -99,9 +99,8 @@ const MCPServers: React.FC<MCPServerProps> = ({ accessToken, userRole, userID })
const targetId = params.get("openUserFields");
if (!targetId) return;
const target = serversWithHealth.find((s) => s.server_id === targetId);
if (target) {
setUserFieldsServer(target);
}
if (!target) return;
setUserFieldsServer(target);
params.delete("openUserFields");
const remaining = params.toString();
const newUrl =