From 3856b96d747114342645e210b7bfb2726cd81039 Mon Sep 17 00:00:00 2001 From: MehulZR Date: Thu, 16 Jan 2025 03:42:54 +0530 Subject: [PATCH] fix: noShowAttendeesDialog closing preemptively --- .../components/booking/BookingListItem.tsx | 53 +++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index 7b6f5d443d8986..8086ef48093329 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -1119,33 +1119,44 @@ const NoShowAttendeesDialog = ({ noShowMutationHelper: (input: RouterInputs["viewer"]["markNoShow"]) => void; }) => { const { t } = useLocale(); + const [noShowAttendees, setNoShowAttendees] = useState(attendees); return ( setIsOpen(false)}> - {attendees.map((attendee) => ( -
{ - e.preventDefault(); - noShowMutationHelper({ - bookingUid, - attendees: [{ email: attendee.email, noShow: !attendee.noShow }], - }); - }}> -
- - {attendee.name} - {attendee.email && ({attendee.email})} - - -
-
+ {noShowAttendees.map((attendee) => ( +
+ + {attendee.name} + {attendee.email && ({attendee.email})} + + +
))} - {t("done")} + + noShowMutationHelper({ + bookingUid, + attendees: noShowAttendees, + }) + }> + {t("done")} +