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 <[email protected]>
Co-authored-by: Somay Chauhan <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-08-06 15:46:08 +00:00
1 parent 003e2630e7
commit 25da11c497
1 file changed
+7
@@ -243,6 +243,10 @@ const Locations: React.FC<LocationsProps> = ({
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<LocationsProps> = ({
credentialId: e.credentialId,
teamName: e.teamName ?? undefined,
}),
...(shouldUpdateLink && {
link: "",
}),
});
} else {
updateLocationField(index, {