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])
|
}, [stayType, stayValue, unregister, setValue])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
sessionStorage.setItem(sessionStorageKey, locationString)
|
if (locationString) {
|
||||||
|
sessionStorage.setItem(sessionStorageKey, locationString)
|
||||||
|
}
|
||||||
}, [locationString])
|
}, [locationString])
|
||||||
|
|
||||||
function getLocationLabel(): string {
|
function getLocationLabel(): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user