From 3f75c6afb0803d99cf606fb7a2a2bf644697390e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 Nov 2021 16:51:34 +0000 Subject: [PATCH] Prevent duplicate avatars in Event List Summaries (#7222) --- src/components/views/elements/EventListSummary.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index 69ae1344cb..e6041b0fff 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { ReactNode, useEffect } from 'react'; +import React, { ReactNode, useEffect } from "react"; +import { uniqBy } from "lodash"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; @@ -80,7 +81,8 @@ const EventListSummary: React.FC = ({ { children } ; } else { - const avatars = summaryMembers.map((m) => ); + const uniqueMembers = uniqBy(summaryMembers, member => member.getMxcAvatarUrl()); + const avatars = uniqueMembers.map((m) => ); body = (