Bug fix, resolve issue with Leave Room button not removing the room from the sidebar

This commit is contained in:
Raven Scott 2024-06-08 01:25:06 -04:00
parent 24ffe2a977
commit e7e80f8791

5
app.js
View File

@ -200,6 +200,11 @@ function switchRoom(topic) {
function leaveRoom() {
if (currentRoom) {
const topic = b4a.toString(currentRoom.topic, 'hex');
const roomItem = document.querySelector(`li[data-topic="${topic}"]`);
if (roomItem) {
roomItem.remove();
}
currentRoom.destroy();
currentRoom = null;
}