diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialogListing/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialogListing/index.tsx index 72cb43f25..1bc53c05d 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialogListing/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialogListing/index.tsx @@ -3,6 +3,7 @@ import { useCallback, useEffect, useRef } from "react" import { useIntl } from "react-intl" +import { useHotelFilterStore } from "@/stores/hotel-filters" import { useHotelsMapStore } from "@/stores/hotels-map" import ListingHotelCardDialog from "../HotelCardDialog/ListingHotelCardDialog" @@ -14,6 +15,7 @@ import type { HotelCardDialogListingProps } from "@/types/components/hotelReserv export default function HotelCardDialogListing({ hotels, + unfilteredHotelCount, }: HotelCardDialogListingProps) { const intl = useIntl() const isRedemption = hotels?.find( @@ -31,6 +33,7 @@ export default function HotelCardDialogListing({ const isScrollingRef = useRef(false) const debounceTimerRef = useRef | null>(null) const { activeHotel, activate, deactivate } = useHotelsMapStore() + const setResultCount = useHotelFilterStore((state) => state.setResultCount) const handleIntersection = useCallback( (entries: IntersectionObserverEntry[]) => { @@ -118,6 +121,10 @@ export default function HotelCardDialogListing({ } }, [dialogRef, activeHotel, deactivate]) + useEffect(() => { + setResultCount(hotels.length, unfilteredHotelCount) + }, [hotels, setResultCount, unfilteredHotelCount]) + return (
{hotelsPinData?.map((data) => { diff --git a/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx index 81613bfee..2c4a9e086 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardListing/index.tsx @@ -102,7 +102,7 @@ export default function HotelCardListing({ }, [activeHotel, type]) useEffect(() => { - setResultCount(hotels.length, unfilteredHotelCount ?? hotels.length) + setResultCount(hotels.length, unfilteredHotelCount) }, [hotels, setResultCount, unfilteredHotelCount]) function isHotelActiveInMapView(hotelName: string): boolean { diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/HotelListing/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/HotelListing/index.tsx index a1c954a2a..47be007d8 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/HotelListing/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/HotelListing/index.tsx @@ -21,7 +21,10 @@ export default function HotelListing({ return isMobile ? (
- +
) : (
diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx index a0e46d2b3..64c61504d 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx @@ -121,7 +121,11 @@ export default async function SelectHotel({ bookingCode={bookingCode} isBookingCodeRateNotAvailable={!isBookingCodeRateAvailable} /> - +
diff --git a/apps/scandic-web/types/components/hotelReservation/selectHotel/hotelCardListingProps.ts b/apps/scandic-web/types/components/hotelReservation/selectHotel/hotelCardListingProps.ts index 37fc863c3..926f7acbc 100644 --- a/apps/scandic-web/types/components/hotelReservation/selectHotel/hotelCardListingProps.ts +++ b/apps/scandic-web/types/components/hotelReservation/selectHotel/hotelCardListingProps.ts @@ -15,7 +15,7 @@ export type HotelData = { export type HotelCardListingProps = { hotelData: HotelResponse[] - unfilteredHotelCount?: number + unfilteredHotelCount: number type?: HotelCardListingTypeEnum isAlternative?: boolean } diff --git a/apps/scandic-web/types/components/hotelReservation/selectHotel/map.ts b/apps/scandic-web/types/components/hotelReservation/selectHotel/map.ts index 4adac5ba9..0918f6c5e 100644 --- a/apps/scandic-web/types/components/hotelReservation/selectHotel/map.ts +++ b/apps/scandic-web/types/components/hotelReservation/selectHotel/map.ts @@ -72,6 +72,7 @@ export interface HotelCardDialogImageProps { export interface HotelCardDialogListingProps { hotels: HotelResponse[] + unfilteredHotelCount: number } export type SelectHotelMapContainerProps = {