Merged in fix/BOOK-130-booking-code-filtering (pull request #2868)
fix(BOOK-130): update booking code filtering on map view and filter and sort modal * fix(BOOK-130): update booking code filtering on map view and filter and sort modal * fix(BOOK-130): change name of filteredIds * fix(BOOK-130): add initial value reduce Approved-by: Joakim Jäderberg Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
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 "../ListingHotelCardDialog"
|
||||
import { getHotelPins } from "./utils"
|
||||
@@ -14,12 +13,10 @@ import type { HotelResponse } from "../SelectHotel/helpers"
|
||||
|
||||
interface HotelCardDialogListingProps {
|
||||
hotels: HotelResponse[]
|
||||
unfilteredHotelCount: number
|
||||
}
|
||||
|
||||
export default function HotelCardDialogListing({
|
||||
hotels,
|
||||
unfilteredHotelCount,
|
||||
}: HotelCardDialogListingProps) {
|
||||
const intl = useIntl()
|
||||
const isRedemption = hotels?.find(
|
||||
@@ -37,7 +34,6 @@ export default function HotelCardDialogListing({
|
||||
const isScrollingRef = useRef<boolean>(false)
|
||||
const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
const { activeHotel, activate, deactivate } = useHotelsMapStore()
|
||||
const setResultCount = useHotelFilterStore((state) => state.setResultCount)
|
||||
|
||||
const handleIntersection = useCallback(
|
||||
(entries: IntersectionObserverEntry[]) => {
|
||||
@@ -125,10 +121,6 @@ export default function HotelCardDialogListing({
|
||||
}
|
||||
}, [dialogRef, activeHotel, deactivate])
|
||||
|
||||
useEffect(() => {
|
||||
setResultCount(hotels.length, unfilteredHotelCount)
|
||||
}, [hotels, setResultCount, unfilteredHotelCount])
|
||||
|
||||
return (
|
||||
<div className={styles.hotelCardDialogListing} ref={dialogRef}>
|
||||
{hotelsPinData?.map((data) => {
|
||||
|
||||
Reference in New Issue
Block a user