[fix](trx-frontend-http): make /status respect per-tab rig selection

pollFreshSnapshot() fetches GET /status on every SSE connect/reconnect,
but /status always returned the global selected rig's state, overwriting
the per-tab display with whichever rig was last switched to globally.

Now pollFreshSnapshot passes rig_id as a query param and the /status
endpoint uses the per-rig watch channel when provided, matching the
/events behavior for true per-tab rig isolation.

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-22 00:14:43 +01:00
parent 0836c815e4
commit f3d8d349b1
2 changed files with 19 additions and 2 deletions
@@ -3163,7 +3163,10 @@ function scheduleReconnect(delayMs = 1000) {
async function pollFreshSnapshot() {
try {
const resp = await fetch("/status", { cache: "no-store" });
const statusUrl = lastActiveRigId
? `/status?rig_id=${encodeURIComponent(lastActiveRigId)}`
: "/status";
const resp = await fetch(statusUrl, { cache: "no-store" });
if (!resp.ok) return;
const data = await resp.json();
render(data);