Fix/prevent duplicate avatars (#8664)

* Prevent duplicate avatars in new booker by also checking on profile url.

* Don't filter out profile without profile url

* Use webapp_url for avatars since that's what is used in the rest of the platform, that way the unique filter on avatar works
This commit is contained in:
Jeroen Reumkens 2023-05-04 12:07:37 +01:00 committed by GitHub
parent 4267c9063b
commit bd5af9e821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import { CAL_URL } from "@calcom/lib/constants";
import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
import { SchedulingType } from "@calcom/prisma/enums";
import { AvatarGroup } from "@calcom/ui";
@ -21,7 +21,7 @@ export const EventMembers = ({ schedulingType, users, profile }: EventMembersPro
const avatars = shownUsers
.map((user) => ({
title: `${user.name}`,
image: "image" in user ? `${user.image}` : `${CAL_URL}/${user.username}/avatar.png`,
image: "image" in user ? `${user.image}` : `${WEBAPP_URL}/${user.username}/avatar.png`,
alt: user.name || undefined,
href: user.username ? `${CAL_URL}/${user.username}` : undefined,
}))