From 7ff29b669cc97d545ee186eb3d4ccaed2d7f98c8 Mon Sep 17 00:00:00 2001 From: Gronod Date: Sun, 17 May 2026 09:02:00 +0100 Subject: [PATCH] fix(ui): status panel empty on login / requires double-click to open showDashboard now explicitly resets the status panel to display:none and clears its innerHTML on every call. This prevents a stale display value from a previous session making toggleStatusPanel think it is already open (causing it to hide on the first click instead of showing). Also cancel the status refresh timer on logout. --- public/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/app.js b/public/app.js index ebe60bb..ef1498c 100644 --- a/public/app.js +++ b/public/app.js @@ -209,6 +209,7 @@ async function handleLogin(e) { async function handleLogout() { try { stopSSE(); + if (statusRefreshHandle) { clearInterval(statusRefreshHandle); statusRefreshHandle = null; } await fetch('/api/auth/logout', { method: 'POST', headers: csrfToken ? { 'X-CSRF-Token': csrfToken } : {} @@ -232,6 +233,10 @@ function showDashboard() { document.getElementById('login-container').style.display = 'none'; document.getElementById('dashboard-container').style.display = 'block'; document.getElementById('currentUser').textContent = currentUser.name || '-'; + // Always start with status panel hidden (guards against stale display value on re-login) + const sp = document.getElementById('status-panel'); + sp.style.display = 'none'; + sp.innerHTML = ''; document.getElementById('admin-controls').style.display = isAdmin ? 'flex' : 'none'; }