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
All checks were successful
Build and Push Docker Image / docker (push) Successful in 8s
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user