[fix](trx-frontend-http): skip auto-appending rig_id when already in URL

postPath() was duplicating rig_id on /select_rig calls, causing deserialization failure and silently dropping the rig switch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-21 22:59:48 +01:00
parent 38f4a71c97
commit 3412827704
@@ -3302,7 +3302,8 @@ window.trxScheduleUiFrameJob = scheduleUiFrameJob;
async function postPath(path) { async function postPath(path) {
// Auto-append rig_id so each tab targets its own rig. // Auto-append rig_id so each tab targets its own rig.
if (lastActiveRigId) { // Skip when the caller already included rig_id (e.g. /select_rig).
if (lastActiveRigId && !path.includes("rig_id=")) {
const sep = path.includes("?") ? "&" : "?"; const sep = path.includes("?") ? "&" : "?";
path = `${path}${sep}rig_id=${encodeURIComponent(lastActiveRigId)}`; path = `${path}${sep}rig_id=${encodeURIComponent(lastActiveRigId)}`;
} }