Dashboard: fix fatal 'rs' redeclaration that blanked the whole page

The risk-strip code declared `const rs = $("risk-status")` in render(), colliding
with the existing `const rs = d.ready_signals` later in the same scope. A
duplicate lexical declaration is a fatal parse error — the ENTIRE <script> never
executed, so render/populateDates/setView were undefined, SSE never connected,
and every field showed '—' (this, not only the API timeout, was why it "didn't
look like it's working"). Renamed the risk element to `rsEl`.

Verified in a headless browser: no JS errors; the date <select> populates with
LIVE + the last sessions, switches to a historical day and back, both views
render (armed radar, watch list, positions, fills, order lifecycle).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
momentum devandClaude Opus 4.8 committed 2026-06-18 22:23:33 -04:00
1 parent 66889bbb15
commit eb380ee804
1 file changed
+3 -3
+3 -3
View File
@@ -586,9 +586,9 @@ function render(d) {
nb.textContent = "⚠ UNPROTECTED: " + rk.unprotected.join(", ") + " — held long with no / short protective stop";
nb.classList.add("show");
} else { nb.classList.remove("show"); }
const rs = $("risk-status");
rs.textContent = (rk.status || "—").toUpperCase();
rs.className = "rdot " + (rk.status || "");
const rsEl = $("risk-status");
rsEl.textContent = (rk.status || "—").toUpperCase();
rsEl.className = "rdot " + (rk.status || "");
$("risk-pos").textContent = (rk.open_positions != null ? rk.open_positions : "—") + " / " + (rk.max_concurrent != null ? rk.max_concurrent : "—");
$("risk-gross").textContent = rk.gross_pct != null ? (rk.gross_pct * 100).toFixed(0) + "% / " + (rk.max_gross_pct * 100).toFixed(0) + "%" : "—";
$("risk-day").textContent = rk.day_pnl_pct != null ? (rk.day_pnl_pct * 100).toFixed(1) + "% / -" + (rk.daily_loss_limit_pct * 100).toFixed(0) + "%" : "—";