mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-09-13 22:32:26 +03:00
use media authentication when rendering avatar
This commit is contained in:
parent
d6caad2f83
commit
492231ce01
1 changed files with 4 additions and 2 deletions
|
@ -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={() => (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue