Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Remove missing users from assignment (#16115)

Syed Ali Shahbaz3d0a853c4b09
diff --git a/packages/features/eventtypes/components/AddMembersWithSwitch.tsx b/packages/features/eventtypes/components/AddMembersWithSwitch.tsx
index 74707dee0e0..2ee0fbef653 100644
--- a/packages/features/eventtypes/components/AddMembersWithSwitch.tsx
+++ b/packages/features/eventtypes/components/AddMembersWithSwitch.tsx
@@ -74,11 +74,13 @@ const CheckedHostField = ({
}}
value={(value || [])
.filter(({ isFixed: _isFixed }) => isFixed === _isFixed)
- .map((host) => {
+ .reduce((acc, host) => {
const option = options.find((member) => member.value === host.userId.toString());
- return option ? { ...option, priority: host.priority ?? 2, isFixed } : options[0];
- })
- .filter(Boolean)}
+ if (!option) return acc;
+
+ acc.push({ ...option, priority: host.priority ?? 2, isFixed });
+ return acc;
+ }, [] as CheckedSelectOption[])}
controlShouldRenderValue={false}
options={options}
placeholder={placeholder}