diff --git a/apps/web/components/dialog/EditLocationDialog.tsx b/apps/web/components/dialog/EditLocationDialog.tsx index c97ec7cab350ed..59ec9ae7ba0ad7 100644 --- a/apps/web/components/dialog/EditLocationDialog.tsx +++ b/apps/web/components/dialog/EditLocationDialog.tsx @@ -223,55 +223,55 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { return ( setShowLocationModal(open)}> -
-
- -
-
-
- -
-
+
{ + const { locationType: newLocationType } = values; + let newLocation; + // For the locations that require organizer to type-in some values, we need the value + if (eventLocationType?.organizerInputType) { + newLocation = values[eventLocationType.variable]; + } else { + // locationType itself can be used here e.g. For zoom we use the type itself which is "integrations:zoom". For Organizer's Default Conferencing App, it is OrganizerDefaultConferencingAppType constant + newLocation = newLocationType; + } -

{t("current_location")}:

-

- {getHumanReadableLocationValue(booking.location, t)} -

- { - const { locationType: newLocationType } = values; - let newLocation; - // For the locations that require organizer to type-in some values, we need the value - if (eventLocationType?.organizerInputType) { - newLocation = values[eventLocationType.variable]; - } else { - // locationType itself can be used here e.g. For zoom we use the type itself which is "integrations:zoom". For Organizer's Default Conferencing App, it is OrganizerDefaultConferencingAppType constant - newLocation = newLocationType; - } + setIsLocationUpdating(true); + try { + await saveLocation({ + newLocation, + credentialId: values.credentialId ?? null, + }); + setIsLocationUpdating(false); + setShowLocationModal(false); + setSelectedLocation?.(undefined); + locationFormMethods.unregister([ + "locationType", + "locationLink", + "locationAddress", + "locationPhoneNumber", + ]); + } catch (error) { + // Let the user retry + setIsLocationUpdating(false); + } + }}> +
+
+ +
+
+
+ +
+
- setIsLocationUpdating(true); - try { - await saveLocation({ - newLocation, - credentialId: values.credentialId ?? null, - }); - setIsLocationUpdating(false); - setShowLocationModal(false); - setSelectedLocation?.(undefined); - locationFormMethods.unregister([ - "locationType", - "locationLink", - "locationAddress", - "locationPhoneNumber", - ]); - } catch (error) { - // Let the user retry - setIsLocationUpdating(false); - } - }}> +

{t("current_location")}:

+

+ {getHumanReadableLocationValue(booking.location, t)} +

{ @@ -328,25 +328,25 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { }} /> {selectedLocation && SelectedLocationInput} - - - - - +
-
+ + + + +
);