Show avatars for non-DM rooms too in the sidebar selectork

This commit is contained in:
Salamandar 2023-01-14 10:07:04 +01:00
parent 4ea14c853e
commit 3963993db0

View file

@ -25,8 +25,9 @@ function Selector({
const noti = initMatrix.notifications; const noti = initMatrix.notifications;
const room = mx.getRoom(roomId); const room = mx.getRoom(roomId);
let imageSrc = room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 24, 24, 'crop') || null; let imageSrc = (isDM
if (imageSrc === null) imageSrc = room.getAvatarUrl(mx.baseUrl, 24, 24, 'crop') || null; ? room.getAvatarFallbackMember()?.getAvatarUrl(mx.baseUrl, 24, 24, 'crop')
: room.getAvatarUrl(mx.baseUrl, 24, 24, 'crop')) || null;
const isMuted = noti.getNotiType(roomId) === cons.notifs.MUTE; const isMuted = noti.getNotiType(roomId) === cons.notifs.MUTE;
@ -57,8 +58,8 @@ function Selector({
key={roomId} key={roomId}
name={room.name} name={room.name}
roomId={roomId} roomId={roomId}
imageSrc={isDM ? imageSrc : null} imageSrc={imageSrc}
iconSrc={isDM ? null : joinRuleToIconSrc(room.getJoinRule(), room.isSpaceRoom())} iconSrc={imageSrc ? null : joinRuleToIconSrc(room.getJoinRule(), room.isSpaceRoom())}
isSelected={navigation.selectedRoomId === roomId} isSelected={navigation.selectedRoomId === roomId}
isMuted={isMuted} isMuted={isMuted}
isUnread={!isMuted && noti.hasNoti(roomId)} isUnread={!isMuted && noti.hasNoti(roomId)}