fix: make cal video default value (#6716)

pull/6692/head^2^2
Nafees Nazik 2023-02-02 16:54:34 +05:30 committed by GitHub
parent 828fcbe1d9
commit 901d1f0e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,16 @@ const getLocationFromType = (
}
};
const getDefaultLocationValue = (options: EventTypeSetupProps["locationOptions"], type: string) => {
for (const locationType of options) {
for (const location of locationType.options) {
if (location.value === type && location.disabled === false) {
return location;
}
}
}
};
export const EventSetupTab = (
props: Pick<EventTypeSetupProps, "eventType" | "locationOptions" | "team" | "teamMembers">
) => {
@ -138,7 +148,8 @@ export const EventSetupTab = (
return true;
});
const defaultValue = locationOptions.find((item) => item.label === "video")?.options;
const defaultValue = getDefaultLocationValue(locationOptions, "integrations:daily");
return (
<div className="w-full">
{validLocations.length === 0 && (