Skip to content

Commit

Permalink
[FIX] Avatars of other chats disappear when they located near chat wi…
Browse files Browse the repository at this point in the history
…th broken avatar (#26689)

Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
  • Loading branch information
Filipe Marins and gabriellsh authored Aug 25, 2022
1 parent 10932a5 commit 862bd08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/meteor/client/sidebar/RoomList/RoomList.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();

Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 862bd08

Please sign in to comment.