[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:
@@ -412,11 +412,12 @@ function currentTheme() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateDocumentTitle(rds = null) {
|
function updateDocumentTitle(rds = null) {
|
||||||
if (!Number.isFinite(lastFreqHz)) {
|
const freqHz = activeChannelFreqHz();
|
||||||
|
if (!Number.isFinite(freqHz)) {
|
||||||
document.title = originalTitle;
|
document.title = originalTitle;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const parts = [formatFreq(lastFreqHz)];
|
const parts = [formatFreq(freqHz)];
|
||||||
const ps = rds?.program_service;
|
const ps = rds?.program_service;
|
||||||
if (ps && ps.length > 0) {
|
if (ps && ps.length > 0) {
|
||||||
parts.push(ps);
|
parts.push(ps);
|
||||||
|
|||||||
@@ -188,6 +188,9 @@ function vchanRender() {
|
|||||||
picker.appendChild(addBtn);
|
picker.appendChild(addBtn);
|
||||||
|
|
||||||
vchanSyncAccentUI();
|
vchanSyncAccentUI();
|
||||||
|
if (typeof updateDocumentTitle === "function" && typeof activeChannelRds === "function") {
|
||||||
|
updateDocumentTitle(activeChannelRds());
|
||||||
|
}
|
||||||
vchanRenderSchedulerRelease();
|
vchanRenderSchedulerRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,6 +392,9 @@ function vchanSyncAccentUI() {
|
|||||||
} else if (typeof _origRefreshFreqDisplay === "function") {
|
} else if (typeof _origRefreshFreqDisplay === "function") {
|
||||||
_origRefreshFreqDisplay();
|
_origRefreshFreqDisplay();
|
||||||
}
|
}
|
||||||
|
if (typeof updateDocumentTitle === "function" && typeof activeChannelRds === "function") {
|
||||||
|
updateDocumentTitle(activeChannelRds());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Saved reference to the original refreshFreqDisplay from app.js.
|
// Saved reference to the original refreshFreqDisplay from app.js.
|
||||||
|
|||||||
Reference in New Issue
Block a user