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:
@@ -661,8 +661,8 @@
|
|||||||
"mbid": "4b5273c8-45f2-4bea-b73c-5128cd57faa8"
|
"mbid": "4b5273c8-45f2-4bea-b73c-5128cd57faa8"
|
||||||
},
|
},
|
||||||
"Eric Carmen - Hungry Eyes (From Dirty Dancing Soundtrack).mp3": {
|
"Eric Carmen - Hungry Eyes (From Dirty Dancing Soundtrack).mp3": {
|
||||||
"year": 2005,
|
"year": 1987,
|
||||||
"date": "2005",
|
"date": "1987",
|
||||||
"title": "Hungry Eyes (From \"Dirty Dancing\" Soundtrack)",
|
"title": "Hungry Eyes (From \"Dirty Dancing\" Soundtrack)",
|
||||||
"artist": "Eric Carmen",
|
"artist": "Eric Carmen",
|
||||||
"mbid": "848ecccf-4fc4-4478-b70a-8e31286bfd84"
|
"mbid": "848ecccf-4fc4-4478-b70a-8e31286bfd84"
|
||||||
@@ -710,8 +710,8 @@
|
|||||||
"mbid": "c9f0a90a-806c-4b60-bdca-1488eda61988"
|
"mbid": "c9f0a90a-806c-4b60-bdca-1488eda61988"
|
||||||
},
|
},
|
||||||
"Fats Domino - Ain't That A Shame.mp3": {
|
"Fats Domino - Ain't That A Shame.mp3": {
|
||||||
"year": 1988,
|
"year": 1955,
|
||||||
"date": "1988",
|
"date": "1955",
|
||||||
"title": "Ain't That A Shame",
|
"title": "Ain't That A Shame",
|
||||||
"artist": "Fats Domino",
|
"artist": "Fats Domino",
|
||||||
"mbid": "ffa16838-9137-42ec-964d-bf668d502593"
|
"mbid": "ffa16838-9137-42ec-964d-bf668d502593"
|
||||||
@@ -1907,8 +1907,8 @@
|
|||||||
"mbid": "c02ff73a-59d3-409c-aa6a-288ad431f3d2"
|
"mbid": "c02ff73a-59d3-409c-aa6a-288ad431f3d2"
|
||||||
},
|
},
|
||||||
"The Rolling Stones - Start Me Up (Remastered 2009).mp3": {
|
"The Rolling Stones - Start Me Up (Remastered 2009).mp3": {
|
||||||
"year": 2023,
|
"year": 1981,
|
||||||
"date": "2023",
|
"date": "1981",
|
||||||
"title": "Start Me Up (Remastered 2009)",
|
"title": "Start Me Up (Remastered 2009)",
|
||||||
"artist": "The Rolling Stones",
|
"artist": "The Rolling Stones",
|
||||||
"mbid": "a832bd7d-2f5a-48f3-960c-161903ddf126"
|
"mbid": "a832bd7d-2f5a-48f3-960c-161903ddf126"
|
||||||
|
|||||||
@@ -230,8 +230,14 @@ function wireUi() {
|
|||||||
});
|
});
|
||||||
wire($leaveRoom, 'click', () => {
|
wire($leaveRoom, 'click', () => {
|
||||||
sendMsg({ type: 'leave_room' });
|
sendMsg({ type: 'leave_room' });
|
||||||
|
// Clear all local storage entries on leave
|
||||||
|
try { localStorage.clear(); } catch {}
|
||||||
stopAudioPlayback();
|
stopAudioPlayback();
|
||||||
state.room = null;
|
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');
|
$lobby.classList.remove('hidden');
|
||||||
$room.classList.add('hidden');
|
$room.classList.add('hidden');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user