diff --git a/app.js b/app.js index 6b39416..d6feafc 100644 --- a/app.js +++ b/app.js @@ -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; }