Merged in fix/book-674-select-hotel-infinite-loop (pull request #3351)
fix(BOOK-674): Refactor how we handle hotel filters * Refactor hotel filters store to URL state * Rename hotel filter store Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -7,7 +7,8 @@ import { alternativeHotels } from "@scandic-hotels/common/constants/routes/hotel
|
||||
import { Alert } from "@scandic-hotels/design-system/Alert"
|
||||
|
||||
import useLang from "../../hooks/useLang"
|
||||
import { useHotelFilterStore } from "../../stores/hotel-filters"
|
||||
import { useHotelResultCountStore } from "../../stores/hotel-result-count"
|
||||
import { useHotelFilters } from "./Filters/useHotelFilters"
|
||||
|
||||
import type { Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||
|
||||
@@ -31,10 +32,10 @@ export default function NoAvailabilityAlert({
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
|
||||
const { resultCount, activeFilters } = useHotelFilterStore((state) => ({
|
||||
const { resultCount } = useHotelResultCountStore((state) => ({
|
||||
resultCount: state.resultCount,
|
||||
activeFilters: state.activeFilters,
|
||||
}))
|
||||
const [activeFilters] = useHotelFilters(null)
|
||||
|
||||
if (activeFilters.length > 0 && resultCount === 0) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user