diff --git a/frontend/src/dialogues/chat/MultiChatDialog.vue b/frontend/src/dialogues/chat/MultiChatDialog.vue index 024a04f..9b0b45f 100644 --- a/frontend/src/dialogues/chat/MultiChatDialog.vue +++ b/frontend/src/dialogues/chat/MultiChatDialog.vue @@ -364,6 +364,7 @@ export default { connectAttemptTimeout: null, joinFallbackTimer: null, roomSyncInFlight: false, + currentRoomName: '', // Faster handshake watchdog separate from reconnect interval handshakeWatchdogMs: 2500, // Rotate to next candidate if a connection never reaches 'open' @@ -756,6 +757,7 @@ export default { initializeRooms(rooms) { this.rooms = rooms; this.selectedRoom = rooms.length ? rooms[0].id : null; + this.currentRoomName = ''; this.autoscroll = true; try { this.urlOverride = localStorage.getItem('chatWsOverride') || ''; } catch (_) { this.urlOverride = ''; } this.messages = []; @@ -1084,6 +1086,8 @@ export default { this.chatWs = null; this.chatConnected = false; this.announcedRoomEnter = false; + this.currentRoomName = ''; + this.roomSyncInFlight = false; this.usersInRoom = []; this.selectedTargetUser = null; }, @@ -1179,12 +1183,7 @@ export default { if (this.joinFallbackTimer) { clearTimeout(this.joinFallbackTimer); this.joinFallbackTimer = null; } const actualRoom = msg.to || msg.room || msg.roomName || ''; const desiredRoom = this.resolveInitialRoomName(); - if (actualRoom) { - const matchingRoom = this.rooms.find((room) => (room.title || room.name) === actualRoom); - if (matchingRoom) { - this.selectedRoom = matchingRoom.id; - } - } + this.currentRoomName = actualRoom || ''; if ( this.adultOnlyMode && desiredRoom