[fix](trx-frontend-http): follow active channel in page title

Use the currently tuned virtual channel for the website title\ninstead of always showing channel 0 metadata.\n\nVerification: node --check assets/web/app.js\nVerification: node --check assets/web/plugins/vchan.js\n\nCo-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-14 13:21:04 +01:00
parent dca01ead90
commit c50f716390
2 changed files with 9 additions and 2 deletions
@@ -412,11 +412,12 @@ function currentTheme() {
}
function updateDocumentTitle(rds = null) {
if (!Number.isFinite(lastFreqHz)) {
const freqHz = activeChannelFreqHz();
if (!Number.isFinite(freqHz)) {
document.title = originalTitle;
return;
}
const parts = [formatFreq(lastFreqHz)];
const parts = [formatFreq(freqHz)];
const ps = rds?.program_service;
if (ps && ps.length > 0) {
parts.push(ps);
@@ -188,6 +188,9 @@ function vchanRender() {
picker.appendChild(addBtn);
vchanSyncAccentUI();
if (typeof updateDocumentTitle === "function" && typeof activeChannelRds === "function") {
updateDocumentTitle(activeChannelRds());
}
vchanRenderSchedulerRelease();
}
@@ -389,6 +392,9 @@ function vchanSyncAccentUI() {
} else if (typeof _origRefreshFreqDisplay === "function") {
_origRefreshFreqDisplay();
}
if (typeof updateDocumentTitle === "function" && typeof activeChannelRds === "function") {
updateDocumentTitle(activeChannelRds());
}
}
// Saved reference to the original refreshFreqDisplay from app.js.