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 <adhabal2002@gmail.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
This commit is contained in:
Sahitya Chandra
2025-09-03 21:15:17 +05:30
committed by GitHub
co-authored by unknown Anik Dhabal Babu
parent a2189643bd
commit cbc27a78ee
@@ -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 });