From 1d733c5ca39914ba9625f9df2bb4bdbb95853fc4 Mon Sep 17 00:00:00 2001 From: Niclas Edenvin Date: Wed, 28 May 2025 08:11:29 +0000 Subject: [PATCH] Merged in fix/SW-2887-complete-booking-button-always-enabled (pull request #2227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(SW-2887): don't disable the booking button The complete button shouldn’t be disabled based on validation. This was already correct in desktop, but now it’s also correct in mobile. * fix(SW-2887): don't disable the booking button Approved-by: Tobias Johansson Approved-by: Christian Andolf --- .../EnterDetails/Payment/PaymentClient.tsx | 16 +------------- .../Summary/Mobile/BottomSheet/index.tsx | 22 +++++++------------ .../scandic-web/stores/enter-details/index.ts | 8 ------- .../scandic-web/types/stores/enter-details.ts | 2 -- 4 files changed, 9 insertions(+), 39 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx index 50acdadd4..d95f9020a 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx @@ -106,10 +106,6 @@ export default function PaymentClient({ return room.mustBeGuaranteed }) - const setIsSubmittingDisabled = useEnterDetailsStore( - (state) => state.actions.setIsSubmittingDisabled - ) - const [refId, setRefId] = useState("") const [isPollingForBookingStatus, setIsPollingForBookingStatus] = useState(false) @@ -284,16 +280,6 @@ export default function PaymentClient({ handlePaymentError, ]) - useEffect(() => { - setIsSubmittingDisabled( - !methods.formState.isValid || methods.formState.isSubmitting - ) - }, [ - methods.formState.isValid, - methods.formState.isSubmitting, - setIsSubmittingDisabled, - ]) - const getPaymentMethod = useCallback( (paymentMethod: string | null | undefined): PaymentMethodEnum => { if (hasFlexRates) { @@ -626,7 +612,7 @@ export default function PaymentClient({