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])
|
||||
|
||||
useEffect(() => {
|
||||
if (locationString) {
|
||||
sessionStorage.setItem(sessionStorageKey, locationString)
|
||||
if (location) {
|
||||
sessionStorage.setItem(sessionStorageKey, JSON.stringify(location))
|
||||
}
|
||||
}, [locationString])
|
||||
}, [location])
|
||||
|
||||
function getLocationLabel(): string {
|
||||
if (location?.type === "hotels") {
|
||||
|
||||
Reference in New Issue
Block a user