From 5a12a321b20e87b2f047b68e87101d3e191c6166 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sat, 21 Mar 2026 23:07:36 +0100 Subject: [PATCH] [fix](trx-frontend-http): make rig switch purely client-side, no /select_rig call The /select_rig endpoint sets global server state which affects all tabs. Since postPath() already sends rig_id with every command, the rig picker now just sets the local lastActiveRigId variable. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- .../trx-frontend-http/assets/web/app.js | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js index 4c8a5dc..58bddac 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js @@ -3349,25 +3349,18 @@ async function switchRigFromSelect(selectEl) { showHint("Unknown rig", 1500); return; } - selectEl.disabled = true; - // Set per-tab rig immediately so subsequent commands target the new rig. + // Rig selection is purely client-side: set the per-tab rig_id so all + // subsequent commands target this rig. No server call needed — postPath() + // auto-appends rig_id to every request. const prevRig = lastActiveRigId; lastActiveRigId = selectEl.value; if (prevRig && prevRig !== lastActiveRigId) { resetDecoderStateOnRigSwitch(); } - showHint("Switching rig…"); - try { - await postPath(`/select_rig?rig_id=${encodeURIComponent(selectEl.value)}`); - refreshRigList(); - showHint("Rig switch requested", 1500); - } catch (err) { - showHint("Rig switch failed", 2000); - console.error(err); - } finally { - const disableSwitch = lastRigIds.length === 0 || !authRole || authRole === "rx"; - selectEl.disabled = disableSwitch; - } + updateRigSubtitle(lastActiveRigId); + if (typeof setSchedulerRig === "function") setSchedulerRig(lastActiveRigId); + if (typeof setBackgroundDecodeRig === "function") setBackgroundDecodeRig(lastActiveRigId); + showHint(`Rig: ${lastActiveRigId}`, 1500); } if (headerRigSwitchSelect) {