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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user