[fix](trx-frontend-http): guard scheduleSpectrumDraw from TDZ during init

scheduleSpectrumDraw references a let-bound variable that hasn't been
initialized yet when setTheme runs at startup. Wrap in try/catch so the
early call is silently skipped.

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 09:25:38 +01:00
parent 84259a01f4
commit 4d09636793
@@ -632,7 +632,7 @@ function setTheme(theme) {
}
// Invalidate cached bookmark chip colours so they pick up the new theme palette.
if (typeof bmRevision !== "undefined") bmRevision++;
if (typeof scheduleSpectrumDraw === "function") scheduleSpectrumDraw();
try { if (typeof scheduleSpectrumDraw === "function") scheduleSpectrumDraw(); } catch (_) {}
}
// ── Style / palette system ────────────────────────────────────────────────────