From 4d0963679333ff3388026b779d1e8cc0f6f6cf4b Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sun, 22 Mar 2026 09:25:38 +0100 Subject: [PATCH] [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 Signed-off-by: Stan Grams --- src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3c16ca5..7b37a98 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 @@ -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 ────────────────────────────────────────────────────