fix(SW-1111): Fix close button on map

This commit is contained in:
Pontus Dreij
2024-12-04 10:53:24 +01:00
parent 9b1d70b3be
commit f1473c1a7c
2 changed files with 7 additions and 2 deletions

View File

@@ -83,7 +83,12 @@ export default function SelectHotelMap({
}
function handlePageRedirect() {
router.push(`${selectHotel(lang)}?${searchParams.toString()}`)
const newUrl = `${selectHotel(lang)}?${searchParams.toString()}`
if (window.history.length > 1) {
router.back()
} else {
router.push(newUrl)
}
}
const closeButton = (

View File

@@ -100,4 +100,4 @@ function HotelListingMapContent({
)
}
export default memo(HotelListingMapContent)
export default HotelListingMapContent