fix: avoid stingifying undefined to session storage
This commit is contained in:
@@ -162,7 +162,9 @@ export default function Search({ locations, handlePressEnter }: SearchProps) {
|
||||
}, [stayType, stayValue, unregister, setValue])
|
||||
|
||||
useEffect(() => {
|
||||
sessionStorage.setItem(sessionStorageKey, locationString)
|
||||
if (locationString) {
|
||||
sessionStorage.setItem(sessionStorageKey, locationString)
|
||||
}
|
||||
}, [locationString])
|
||||
|
||||
function getLocationLabel(): string {
|
||||
|
||||
Reference in New Issue
Block a user