[fix](trx-frontend-http): hide rig selector when logged out

Keep the top bar visible for unauthenticated users, but\nhide the rig selector until a session is established.\n\nCo-authored-by: Codex <codex@openai.com>

Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 08:57:02 +01:00
parent b27c2f8d73
commit c7b99f6fa9
@@ -330,6 +330,7 @@ let overviewPeakHoldMs = Number(loadSetting("overviewPeakHoldMs", 2000));
function syncTopBarAccess() { function syncTopBarAccess() {
const loggedOut = authEnabled && !authRole; const loggedOut = authEnabled && !authRole;
const tabBar = document.getElementById("tab-bar"); const tabBar = document.getElementById("tab-bar");
const rigSwitch = document.querySelector(".header-rig-switch");
if (tabBar) tabBar.style.display = ""; if (tabBar) tabBar.style.display = "";
document.querySelectorAll(".tab-bar .tab").forEach((btn) => { document.querySelectorAll(".tab-bar .tab").forEach((btn) => {
@@ -338,6 +339,10 @@ function syncTopBarAccess() {
btn.disabled = false; btn.disabled = false;
}); });
if (rigSwitch) {
rigSwitch.style.display = loggedOut ? "none" : "";
}
if (headerRigSwitchSelect) { if (headerRigSwitchSelect) {
headerRigSwitchSelect.disabled = loggedOut || authRole === "rx" || lastRigIds.length === 0; headerRigSwitchSelect.disabled = loggedOut || authRole === "rx" || lastRigIds.length === 0;
} }