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.
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user