From 25da11c497561fa335bbf8c77f70bb0dc96943c0 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Tue, 6 Aug 2024 21:16:08 +0530 Subject: [PATCH] fix: issue in the event location field (#15229) * fix: issues in event location field * Update EventSetupTab.tsx * Update EventSetupTab.tsx * update --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Somay Chauhan Co-authored-by: Peer Richelsen --- apps/web/components/eventtype/Locations.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/web/components/eventtype/Locations.tsx b/apps/web/components/eventtype/Locations.tsx index 159d5fc608..eebf5302e0 100644 --- a/apps/web/components/eventtype/Locations.tsx +++ b/apps/web/components/eventtype/Locations.tsx @@ -243,6 +243,10 @@ const Locations: React.FC = ({ eventLocationType.organizerInputType || !validLocations?.find((location) => location.type === newLocationType); + const shouldUpdateLink = + eventLocationType?.organizerInputType === "text" && + eventLocationType.defaultValueVariable === "link"; + if (canAddLocation) { updateLocationField(index, { type: newLocationType, @@ -250,6 +254,9 @@ const Locations: React.FC = ({ credentialId: e.credentialId, teamName: e.teamName ?? undefined, }), + ...(shouldUpdateLink && { + link: "", + }), }); } else { updateLocationField(index, {