[fix](trx-frontend-http): fix TDZ on lastSpectrumData at style init

Same root cause as the overviewDrawPending TDZ: setStyle() references
lastSpectrumData at module init time but it was declared far below.
Hoist let lastSpectrumData = null to the top variable block and remove
the now-duplicate declaration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 01:53:08 +01:00
parent 4f650f5ffb
commit 4930e5cc45
@@ -333,6 +333,7 @@ const headerStylePickSelect = document.getElementById("header-style-pick-select"
let overviewPeakHoldMs = Number(loadSetting("overviewPeakHoldMs", 2000));
let overviewDrawPending = false;
let lastSpectrumData = null;
let lastControl;
let lastTxEn = null;
let lastHasTx = true;
@@ -2723,7 +2724,6 @@ const spectrumFreqAxis = document.getElementById("spectrum-freq-axis");
const spectrumTooltip = document.getElementById("spectrum-tooltip");
let spectrumSource = null;
let spectrumReconnectTimer = null;
let lastSpectrumData = null;
let spectrumDrawPending = false;
let spectrumAxisKey = "";