fix: incorrect slot duration when rescheduling bookings (#23290)
* fix: incorrect slot duration when rescheduling bookings * chore * chore * some code refactor * chore * chore * fix --------- Co-authored-by: unknown <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
1 file changed
-10
@@ -370,18 +370,8 @@ export const createBookerStore = () =>
|
||||
// if the user reschedules a booking right after the confirmation page.
|
||||
// In that case the time would still be store in the store, this way we
|
||||
// force clear this.
|
||||
// Also, fetch the original booking duration if user is rescheduling and
|
||||
// update the selectedDuration
|
||||
if (rescheduleUid && bookingData) {
|
||||
set({ selectedTimeslot: null });
|
||||
const originalBookingLength = dayjs(bookingData?.endTime).diff(
|
||||
dayjs(bookingData?.startTime),
|
||||
"minutes"
|
||||
);
|
||||
set({ selectedDuration: originalBookingLength });
|
||||
if (!isPlatform || allowUpdatingUrlParams) {
|
||||
updateQueryParam("duration", originalBookingLength ?? "");
|
||||
}
|
||||
}
|
||||
if (month) set({ month });
|
||||
|
||||
|
||||
Reference in new issue
Block a user