From 862bd08cb9c335cd5a1166a41ff5e0c314cbb9fa Mon Sep 17 00:00:00 2001 From: Filipe Marins <filipe.marins@rocket.chat> Date: Thu, 25 Aug 2022 18:04:11 -0300 Subject: [PATCH] [FIX] Avatars of other chats disappear when they located near chat with broken avatar (#26689) Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com> --- apps/meteor/client/sidebar/RoomList/RoomList.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/meteor/client/sidebar/RoomList/RoomList.tsx b/apps/meteor/client/sidebar/RoomList/RoomList.tsx index c9b1c47a2c0..d5ae9bb8266 100644 --- a/apps/meteor/client/sidebar/RoomList/RoomList.tsx +++ b/apps/meteor/client/sidebar/RoomList/RoomList.tsx @@ -1,3 +1,4 @@ +import { IRoom } from '@rocket.chat/core-typings'; import { Box } from '@rocket.chat/fuselage'; import { useResizeObserver } from '@rocket.chat/fuselage-hooks'; import { useSession, useUserPreference, useUserId, useTranslation } from '@rocket.chat/ui-contexts'; @@ -13,6 +14,8 @@ import { useTemplateByViewMode } from '../hooks/useTemplateByViewMode'; import Row from './Row'; import ScrollerWithCustomProps from './ScrollerWithCustomProps'; +const computeItemKey = (index: number, room: IRoom): IRoom['_id'] | number => room._id || index; + const RoomList = (): ReactElement => { useSidebarPaletteColor(); @@ -50,6 +53,7 @@ const RoomList = (): ReactElement => { totalCount={roomsList.length} data={roomsList} components={{ Scroller: ScrollerWithCustomProps }} + computeItemKey={computeItemKey} itemContent={(_, data): ReactElement => <Row data={itemData} item={data} />} /> </Box> -- GitLab