fix: pass correct location data to session storage
This commit is contained in:
@@ -162,10 +162,10 @@ export default function Search({ locations, handlePressEnter }: SearchProps) {
|
|||||||
}, [stayType, stayValue, unregister, setValue])
|
}, [stayType, stayValue, unregister, setValue])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (locationString) {
|
if (location) {
|
||||||
sessionStorage.setItem(sessionStorageKey, locationString)
|
sessionStorage.setItem(sessionStorageKey, JSON.stringify(location))
|
||||||
}
|
}
|
||||||
}, [locationString])
|
}, [location])
|
||||||
|
|
||||||
function getLocationLabel(): string {
|
function getLocationLabel(): string {
|
||||||
if (location?.type === "hotels") {
|
if (location?.type === "hotels") {
|
||||||
|
|||||||
Reference in New Issue
Block a user