From 5e9902921ff2e59ed7a5af16dd861f635e49f7f8 Mon Sep 17 00:00:00 2001 From: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Date: Wed, 15 May 2024 22:55:35 +0530 Subject: [PATCH] fix: Dynamic (Group) meetings showing one person avatar on the double (#15055) --- .../components/event-meta/Members.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/features/bookings/components/event-meta/Members.tsx b/packages/features/bookings/components/event-meta/Members.tsx index 12a0c8f51a..0888661946 100644 --- a/packages/features/bookings/components/event-meta/Members.tsx +++ b/packages/features/bookings/components/event-meta/Members.tsx @@ -1,4 +1,5 @@ import { useIsEmbed } from "@calcom/embed-core/embed-iframe"; +import { useBookerStore } from "@calcom/features/bookings/Booker/store"; import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl"; import { getBookerBaseUrlSync } from "@calcom/lib/getBookerUrl/client"; import { SchedulingType } from "@calcom/prisma/enums"; @@ -18,6 +19,8 @@ export interface EventMembersProps { } export const EventMembers = ({ schedulingType, users, profile, entity }: EventMembersProps) => { + const username = useBookerStore((state) => state.username); + const isDynamic = !!(username && username.indexOf("+") > -1); const isEmbed = useIsEmbed(); const showMembers = !!schedulingType && schedulingType !== SchedulingType.ROUND_ROBIN; const shownUsers = showMembers ? users : []; @@ -34,13 +37,17 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe size="sm" className="border-muted" items={[ - { - // We don't want booker to be able to see the list of other users or teams inside the embed - href: isEmbed ? null : getBookerBaseUrlSync(entity.orgSlug), - image: profile.image || "", - alt: profile.name || "", - title: profile.name || "", - }, + ...(isDynamic + ? [] + : [ + { + // We don't want booker to be able to see the list of other users or teams inside the embed + href: isEmbed ? null : getBookerBaseUrlSync(entity.orgSlug), + image: profile.image || "", + alt: profile.name || "", + title: profile.name || "", + }, + ]), ...shownUsers.map((user) => ({ href: `${getBookerBaseUrlSync(user.profile?.organization?.slug ?? null)}/${ user.profile?.username