fix: resolve federated avatar color to home instance identity
Federated users get a different snowflake ID on remote instances, causing avatar gradients to mismatch their home identity. Apply resolveDisplayIdentity/isSelf resolution in VoiceUser, StreamTile, VoiceChannel sidebar, and MemberSidebar so the current user's avatar color is consistent across all views.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { useRef, useEffect, useState, useCallback } from 'react';
|
||||
import { Avatar } from '../ui/Avatar';
|
||||
import { useVoiceStore } from '../../stores/voiceStore';
|
||||
import { useAuthStore } from '../../stores/authStore';
|
||||
import type { UserTile } from '../../hooks/useLiveKit';
|
||||
|
||||
interface VoiceUserProps {
|
||||
@@ -20,6 +21,8 @@ export function VoiceUser({ tile, large }: VoiceUserProps) {
|
||||
|
||||
const perUserVolume = participantVolumes.get(participant.userId) ?? 100;
|
||||
const isLocal = participant.isLocal;
|
||||
const homeUser = useAuthStore((s) => s.user);
|
||||
const avatarUserId = isLocal ? (homeUser?.id ?? participant.userId) : participant.userId;
|
||||
|
||||
// --- VIDEO & UI ---
|
||||
|
||||
@@ -95,7 +98,7 @@ export function VoiceUser({ tile, large }: VoiceUserProps) {
|
||||
src={null}
|
||||
name={participant.username}
|
||||
size={large ? 100 : 64}
|
||||
userId={participant.userId}
|
||||
userId={avatarUserId}
|
||||
/>
|
||||
{isSpeaking && (
|
||||
<div className="absolute -inset-1.5 rounded-full ring-[3px] ring-status-online animate-pulse" />
|
||||
|
||||
Reference in New Issue
Block a user