refactor: clear local storage and reset UI elements on room leave
All checks were successful
Build and Push Docker Image / docker (push) Successful in 8s

This commit is contained in:
2025-09-04 20:51:11 +02:00
parent df8b9a3e00
commit ba08e05117
2 changed files with 12 additions and 6 deletions

View File

@@ -230,8 +230,14 @@ function wireUi() {
});
wire($leaveRoom, 'click', () => {
sendMsg({ type: 'leave_room' });
// Clear all local storage entries on leave
try { localStorage.clear(); } catch {}
stopAudioPlayback();
state.room = null;
// Reset visible name inputs/labels
if ($nameLobby) { try { $nameLobby.value = ''; } catch {} }
if ($nameDisplay) { $nameDisplay.textContent = ''; }
if ($readyChk) { try { $readyChk.checked = false; } catch {} }
$lobby.classList.remove('hidden');
$room.classList.add('hidden');
});