From 5bf18f04124b5ffef925c4ee74558fcd79150385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20J=C3=A4derberg?= Date: Fri, 3 Oct 2025 12:50:30 +0000 Subject: [PATCH] Merged in fix/optional-chaining-lint-issue (pull request #2905) * remove optional chaining with force unrwap Approved-by: Bianca Widstam --- .../SelectRate/RoomsContainer/index.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/booking-flow/lib/components/SelectRate/RoomsContainer/index.tsx b/packages/booking-flow/lib/components/SelectRate/RoomsContainer/index.tsx index 7e8070c2b..4c4a0a894 100644 --- a/packages/booking-flow/lib/components/SelectRate/RoomsContainer/index.tsx +++ b/packages/booking-flow/lib/components/SelectRate/RoomsContainer/index.tsx @@ -31,18 +31,20 @@ export function RoomsContainer({}: RoomsContainerProps) { } = useSelectRateContext() useEffect(() => { - if (availabilityData) { - const lowestRoomPrice = getLowestRoomPrice() - const booking = inputData?.booking! + if (!availabilityData) return - trackLowestRoomPrice({ - hotelId: booking.hotelId, - arrivalDate: booking?.fromDate, - departureDate: booking?.toDate, - lowestPrice: lowestRoomPrice.price.toString(), - currency: lowestRoomPrice.currency, - }) - } + const lowestRoomPrice = getLowestRoomPrice() + const booking = inputData?.booking + + if (!booking) return + + trackLowestRoomPrice({ + hotelId: booking.hotelId, + arrivalDate: booking?.fromDate, + departureDate: booking?.toDate, + lowestPrice: lowestRoomPrice.price.toString(), + currency: lowestRoomPrice.currency, + }) }, [availabilityData, inputData, getLowestRoomPrice]) if (isFetching) {