fix: resolve duplicate voice user in federated channel sidebar
Use origin-aware user ID resolution for optimistic voice add/remove instead of always using the home instance ID. Adds getMyUserIdForOrigin resolver (same pattern as getApiForOrigin) so joinVoiceChannel and leaveVoice use the correct federated user ID. Also fixes WS reconnect voice re-registration, invite URL for remote servers, and chatStore early-load guard for unmapped channels.
This commit is contained in:
@@ -2,8 +2,7 @@ import { create } from 'zustand';
|
||||
import { persist, createJSONStorage } from 'zustand/middleware';
|
||||
import type { ParticipantInfo } from '../hooks/useLiveKit';
|
||||
import { AudioManager } from '../audio/AudioManager';
|
||||
import { useServerStore } from './serverStore';
|
||||
import { useAuthStore } from './authStore';
|
||||
import { useServerStore, getChannelOrigin, getMyUserIdForOrigin } from './serverStore';
|
||||
|
||||
export interface ScreenShareConfig {
|
||||
height: 1080 | 720 | 540;
|
||||
@@ -294,7 +293,7 @@ export const useVoiceStore = create<VoiceState>()(
|
||||
// Leave voice without wiping the voiceUsers map (so sidebar still shows others)
|
||||
leaveVoice: () => {
|
||||
const channelId = get().currentVoiceChannelId;
|
||||
const myId = useAuthStore.getState().user?.id;
|
||||
const myId = channelId ? getMyUserIdForOrigin(getChannelOrigin(channelId)) : undefined;
|
||||
|
||||
set((state) => {
|
||||
// Optimistic: immediately remove self from the channel's voice users
|
||||
|
||||
Reference in New Issue
Block a user