use media authentication when rendering avatar

This commit is contained in:
Ajay Bura 2025-08-27 16:45:40 +05:30
parent d6caad2f83
commit 492231ce01

View file

@ -57,6 +57,7 @@ import { UnreadBadge, UnreadBadgeCenter } from '../../components/unread-badge';
import { searchModalAtom } from '../../state/searchModal'; import { searchModalAtom } from '../../state/searchModal';
import { useKeyDown } from '../../hooks/useKeyDown'; import { useKeyDown } from '../../hooks/useKeyDown';
import navigation from '../../../client/state/navigation'; import navigation from '../../../client/state/navigation';
import { useMediaAuthentication } from '../../hooks/useMediaAuthentication';
enum SearchRoomType { enum SearchRoomType {
Rooms = '#', Rooms = '#',
@ -134,6 +135,7 @@ type SearchProps = {
}; };
export function Search({ requestClose }: SearchProps) { export function Search({ requestClose }: SearchProps) {
const mx = useMatrixClient(); const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication();
const scrollRef = useRef<HTMLDivElement>(null); const scrollRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLInputElement>(null); const inputRef = useRef<HTMLInputElement>(null);
const { navigateRoom, navigateSpace } = useRoomNavigate(); const { navigateRoom, navigateSpace } = useRoomNavigate();
@ -356,8 +358,8 @@ export function Search({ requestClose }: SearchProps) {
roomId={room.roomId} roomId={room.roomId}
src={ src={
dm dm
? getDirectRoomAvatarUrl(mx, room) ? getDirectRoomAvatarUrl(mx, room, 32, useAuthentication)
: getRoomAvatarUrl(mx, room) : getRoomAvatarUrl(mx, room, 32, useAuthentication)
} }
alt={room.name} alt={room.name}
renderFallback={() => ( renderFallback={() => (