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:
@@ -132,9 +132,12 @@ export const useChatStore = create<ChatState>((set, get) => ({
|
||||
|
||||
loadMessages: async (channelId: string, force?: boolean) => {
|
||||
if (!force && get().hasMore.has(channelId)) return;
|
||||
const isDm = isDmChannel(channelId);
|
||||
// For server channels, bail if we don't know which instance owns this channel yet.
|
||||
// The remote WS ready handler will call loadMessages once the map is populated.
|
||||
if (!isDm && !useServerStore.getState().channelOriginMap.has(channelId)) return;
|
||||
set({ isLoading: true, loadError: null });
|
||||
try {
|
||||
const isDm = isDmChannel(channelId);
|
||||
const origin = getChannelOrigin(channelId);
|
||||
const client = getApiForOrigin(origin);
|
||||
const messages = isDm
|
||||
|
||||
Reference in New Issue
Block a user