From 9d77e8ab9f881809032ecef356c2fcd00c4dd44a Mon Sep 17 00:00:00 2001 From: Shea Duma Date: Sat, 11 Apr 2026 20:43:34 +0300 Subject: [PATCH] small fix sticking and showing the wrong item in the preview --- .changeset/fix-status-sticking-issue.md | 4 ++++ src/app/features/room-nav/RoomNavItem.tsx | 4 +--- src/app/pages/client/sidebar/DirectDMsList.tsx | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/fix-status-sticking-issue.md diff --git a/.changeset/fix-status-sticking-issue.md b/.changeset/fix-status-sticking-issue.md new file mode 100644 index 000000000..f9731da7e --- /dev/null +++ b/.changeset/fix-status-sticking-issue.md @@ -0,0 +1,4 @@ +--- +default: patch +--- +Fix status sometimes sticking in member tile diff --git a/src/app/features/room-nav/RoomNavItem.tsx b/src/app/features/room-nav/RoomNavItem.tsx index 15e615720..9ae9766fa 100644 --- a/src/app/features/room-nav/RoomNavItem.tsx +++ b/src/app/features/room-nav/RoomNavItem.tsx @@ -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; diff --git a/src/app/pages/client/sidebar/DirectDMsList.tsx b/src/app/pages/client/sidebar/DirectDMsList.tsx index 16e829ce5..fa277695a 100644 --- a/src/app/pages/client/sidebar/DirectDMsList.tsx +++ b/src/app/pages/client/sidebar/DirectDMsList.tsx @@ -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) { (