[fix](trx-frontend-http): fix bookmark markers invisible on spectrum

let-declared bmList is not a window property, so window.bmList in
app.js always returned undefined. Change to var so it lands on window;
read it via typeof guard in app.js to stay safe if bookmarks.js is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-01 19:43:33 +01:00
parent 473bbb280a
commit 53da1570ec
2 changed files with 7 additions and 5 deletions
@@ -4268,8 +4268,9 @@ function drawSpectrum(data) {
} }
// ── Bookmark frequency markers ───────────────────────────────────────────── // ── Bookmark frequency markers ─────────────────────────────────────────────
const visBookmarks = Array.isArray(window.bmList) const _bmListRef = typeof bmList !== "undefined" ? bmList : null;
? window.bmList.filter((bm) => bm.freq_hz >= range.visLoHz && bm.freq_hz <= range.visHiHz) const visBookmarks = Array.isArray(_bmListRef)
? _bmListRef.filter((bm) => bm.freq_hz >= range.visLoHz && bm.freq_hz <= range.visHiHz)
: []; : [];
if (visBookmarks.length > 0) { if (visBookmarks.length > 0) {
ctx.save(); ctx.save();
@@ -4317,8 +4318,9 @@ function updateBookmarkAxis(range) {
const freqAxisEl = document.getElementById("spectrum-freq-axis"); const freqAxisEl = document.getElementById("spectrum-freq-axis");
if (!axisEl) return; if (!axisEl) return;
const visBookmarks = Array.isArray(window.bmList) const _bmRef = typeof bmList !== "undefined" ? bmList : null;
? window.bmList.filter((bm) => bm.freq_hz >= range.visLoHz && bm.freq_hz <= range.visHiHz) const visBookmarks = Array.isArray(_bmRef)
? _bmRef.filter((bm) => bm.freq_hz >= range.visLoHz && bm.freq_hz <= range.visHiHz)
: []; : [];
const hasVisible = visBookmarks.length > 0; const hasVisible = visBookmarks.length > 0;
@@ -1,6 +1,6 @@
// --- Bookmarks Tab --- // --- Bookmarks Tab ---
let bmList = []; var bmList = [];
let bmEditId = null; let bmEditId = null;
function bmFmtFreq(hz) { function bmFmtFreq(hz) {