[fix](trx-frontend-http): fix rig initialization freeze caused by auth-badge inside template
The auth-badge element was wrapped inside <template id="tmpl-about">, making it invisible to document.getElementById() at page load. updateAuthUI() accessed badge.style without a null check, throwing a TypeError that halted app initialization before connect() was called. Move auth-badge outside the template so it is always in the live DOM, and add defensive null guards on badge/badgeRole access. https://claude.ai/code/session_01Km7uxYUzehpYBdYqncnt4n Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -174,14 +174,14 @@ function updateAuthUI() {
|
||||
}
|
||||
|
||||
if (authRole) {
|
||||
badge.style.display = "block";
|
||||
badgeRole.textContent = authRole === "control" ? "Control (full access)" : "RX (read-only)";
|
||||
if (badge) badge.style.display = "block";
|
||||
if (badgeRole) badgeRole.textContent = authRole === "control" ? "Control (full access)" : "RX (read-only)";
|
||||
if (headerAuthBtn) {
|
||||
headerAuthBtn.textContent = "Logout";
|
||||
headerAuthBtn.style.display = "block";
|
||||
}
|
||||
} else {
|
||||
badge.style.display = "none";
|
||||
if (badge) badge.style.display = "none";
|
||||
if (headerAuthBtn) {
|
||||
headerAuthBtn.textContent = "Login";
|
||||
headerAuthBtn.style.display = "block";
|
||||
|
||||
Reference in New Issue
Block a user