From 481044346c603115e7592efe66f4da89ee921c50 Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Tue, 1 Jul 2025 10:42:56 +0000 Subject: [PATCH] Merged in fix/SW-3001-booking-codes-all-rates-default (pull request #2489) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(SW-3001): show booking codes rates by default * fix(SW-3001): show booking codes rates by default * fix(SW-3001): pr comment remove useEffect Approved-by: Anton Gunnarsson Approved-by: Matilda Landström --- .../SelectHotel/BookingCodeFilter/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/BookingCodeFilter/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/BookingCodeFilter/index.tsx index 93b5aaaa9..2136b14b6 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/BookingCodeFilter/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/BookingCodeFilter/index.tsx @@ -31,7 +31,12 @@ export default function BookingCodeFilter() { const activeCodeFilter = useBookingCodeFilterStore( (state) => state.activeCodeFilter ) - const setFilter = useBookingCodeFilterStore((state) => state.setFilter) + const [filter, setFilter] = useState( + BookingCodeFilterEnum.Discounted + ) + + const setStoreFilter = useBookingCodeFilterStore((state) => state.setFilter) + const displayAsPopover = useMediaQuery("(min-width: 768px)") const bookingCodeFilterItems = [ @@ -51,6 +56,7 @@ export default function BookingCodeFilter() { function updateFilter(selectedFilter: string) { setFilter(selectedFilter as BookingCodeFilterEnum) + setStoreFilter(filter) } // To fix the hyderation error