fix(ui): status panel empty on login / requires double-click to open
Some checks failed
Build and Push Docker Image / build (push) Successful in 26s
CI / Security audit (push) Successful in 40s
CI / Tests & coverage (push) Failing after 36s

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.
This commit is contained in:
2026-05-17 09:02:00 +01:00
parent 0dbf0e0899
commit 7ff29b669c

View File

@@ -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';
}