Scheduling infrastructure for absolutely everyone.
fix: useGetBookingForReschedule wait for calProvider init (#15236)
Morgan4cdcc8562094
diff --git a/packages/platform/atoms/hooks/useGetBookingForReschedule.ts b/packages/platform/atoms/hooks/useGetBookingForReschedule.tsindex b2d7f364f1a..ca7999ebc8b 100644--- a/packages/platform/atoms/hooks/useGetBookingForReschedule.ts+++ b/packages/platform/atoms/hooks/useGetBookingForReschedule.ts@@ -5,6 +5,7 @@ import type { getBookingForReschedule } from "@calcom/platform-libraries";import type { ApiResponse, ApiSuccessResponse } from "@calcom/platform-types";import http from "../lib/http";+import { useAtomsContext } from "./useAtomsContext";export const QUERY_KEY = "user-booking";@@ -24,8 +25,8 @@ export const useGetBookingForReschedule = (uid: "",}) => {+ const { isInit } = useAtomsContext();const pathname = `/${V2_ENDPOINTS.bookings}/${props.uid}/reschedule`;-const bookingQuery = useQuery({queryKey: [QUERY_KEY, props.uid],queryFn: () => {@@ -46,7 +47,7 @@ export const useGetBookingForReschedule = (props.onError?.(err);});},- enabled: !!props?.uid,+ enabled: isInit && !!props?.uid,});return bookingQuery;