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 <somaychauhan98@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Anik Dhabal Babu
2024-08-06 15:46:08 +00:00
committed by GitHub
co-authored by Udit Takkar Somay Chauhan Peer Richelsen
parent 003e2630e7
commit 25da11c497
@@ -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, {