fix: prevent ghost users in voice sidebar after deploy

Send voice_join to WS server only after LiveKit successfully connects,
not immediately on joinVoiceChannel() or WS reconnect. Background tabs
can reconnect WebSocket but not WebRTC, causing phantom voice users.
This commit is contained in:
Jannis Braun
2026-03-04 22:11:50 +01:00
parent a5073f89fd
commit dd02c1ed8d
3 changed files with 25 additions and 10 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ export function joinVoiceChannel(channelId: string): void {
}
setCurrentVoiceChannel(channelId);
wsSend({ type: 'voice_join', channelId }, getChannelOrigin(channelId));
// voice_join is now sent by useLiveKit after successful LiveKit connection
// Optimistic: immediately show self in new channel
if (myId) addVoiceUser(channelId, myId);
}