small fix sticking and showing the wrong item in the preview

This commit is contained in:
Shea Duma committed 2026-04-11 20:43:34 +03:00
1 parent 6a895f8de1
commit 9d77e8ab9f
3 files changed
+10 -5

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
---
default: patch
---
Fix status sometimes sticking in member tile
+1 -3
View File
@@ -293,10 +293,8 @@ export function RoomNavItem({
const matrixRoomName = useRoomName(room);
const roomName = (dmUserId && nicknames[dmUserId]) || matrixRoomName;
const presence = useUserPresence(dmUserId ?? '');
const [topicEvent, setTopicEvent] = useState(getStateEvent(room, StateEvent.RoomTopic));
const topicEvent = getStateEvent(room, StateEvent.RoomTopic);
// Ensures that the description does not stick to the position the room is in the row
useEffect(() => setTopicEvent(getStateEvent(room, StateEvent.RoomTopic)), [room, setTopicEvent]);
const roomDescription = direct
? (customDMCards && (topicEvent?.getContent().topic as string)) || presence?.status
: undefined;
@@ -15,7 +15,7 @@ import {
} from '$components/sidebar';
import { RoomAvatar } from '$components/room-avatar';
import { UserAvatar } from '$components/user-avatar';
import { getDirectRoomAvatarUrl } from '$utils/room';
import { getDirectRoomAvatarUrl, getRoomAvatarUrl } from '$utils/room';
import { useMediaAuthentication } from '$hooks/useMediaAuthentication';
import { nameInitials } from '$utils/common';
import { getCanonicalAliasOrRoomId, mxcUrlToHttp } from '$utils/matrix';
@@ -69,7 +69,10 @@ function DMItem({ room, selected }: DMItemProps) {
<Avatar size="400" radii="400">
<RoomAvatar
roomId={room.roomId}
src={getDirectRoomAvatarUrl(mx, room, 96, useAuthentication)}
src={
getRoomAvatarUrl(mx, room, 96, useAuthentication) ||
getDirectRoomAvatarUrl(mx, room, 96, useAuthentication)
}
alt={room.name}
renderFallback={() => (
<Text as="span" size="H6">