chore(dependencies): update package-lock.json and package.json for dependency versions

- Upgraded @emnapi/runtime to version 1.9.1 and @img/colour to version 1.1.0 in package-lock.json.
- Added new dependencies for ansi-regex and strip-ansi with updated versions in multiple locations.
- Updated lodash types to version 4.17.24 and ansi-escapes to version 7.3.0.
- Introduced overrides for minimatch and tmp in package.json to ensure consistent behavior across environments.
- Refactored MultiChatDialog.vue to improve room selection logic and handle adult-only mode more effectively.
This commit is contained in:
Torsten Schulz (local)
2026-03-27 14:05:29 +01:00
parent 07604cc9fa
commit 9f3facbb3f
3 changed files with 244 additions and 158 deletions

View File

@@ -767,14 +767,23 @@ export default {
this.loadOwnRooms();
this.announcedRoomEnter = false;
this.$refs.dialog.open();
// Stelle die WS-Verbindung her, wenn der Dialog geöffnet wird
this.opened = true;
if (this.adultOnlyMode && !this.resolveInitialRoomName()) {
this.setStatus('idle');
return;
}
// Stelle die WS-Verbindung her, wenn der Dialog geöffnet wird
this.connectChatSocket();
// Add network event listeners
window.addEventListener('online', this.onOnline);
window.addEventListener('offline', this.onOffline);
},
connectChatSocket() {
if (this.adultOnlyMode && !this.resolveInitialRoomName()) {
console.warn('[Chat WS] adult mode without selected room - aborting connect');
this.setStatus('idle');
return;
}
if (this.connectRacing) return; // avoid overlapping races
try { this.chatWs?.close(1000, 'reconnect'); } catch (_) { }
this.chatWs = null;
@@ -882,7 +891,7 @@ export default {
// Drop references to losers so GC can collect
this.pendingWs = [];
// Prepare handshake like before
const initRoom = this.getSelectedRoomName() || '';
const initRoom = this.resolveInitialRoomName();
const init = { type: 'init', name: this.user?.username || '', room: initRoom, password: this.getRoomPassword(initRoom) };
if (this.debug) console.log('[Chat WS >>]', init);
this.wsSend(init);
@@ -980,7 +989,7 @@ export default {
this.transportConnected = true;
const dt = Date.now() - (this.wsStartAt || Date.now());
console.log('[Chat WS] open in', dt, 'ms', '| protocol:', ws.protocol || '(none)', '| url:', url);
const initRoom = this.getSelectedRoomName() || '';
const initRoom = this.resolveInitialRoomName();
const init = { type: 'init', name: this.user?.username || '', room: initRoom, password: this.getRoomPassword(initRoom) };
if (this.debug) console.log('[Chat WS >>]', init);
this.wsSend(init);
@@ -1118,6 +1127,22 @@ export default {
const r = this.rooms.find(x => x.id === this.selectedRoom);
return r?.title || r?.name || '';
},
resolveInitialRoomName() {
const selectedRoomName = this.getSelectedRoomName();
if (selectedRoomName) {
return selectedRoomName;
}
const fallbackRoom = this.rooms[0];
if (!fallbackRoom) {
return '';
}
if (!this.selectedRoom) {
this.selectedRoom = fallbackRoom.id;
}
return fallbackRoom.title || fallbackRoom.name || '';
},
handleIncoming(msg) {
if (!msg) return;
if (msg.type === 'message' || msg.type === 4) {