From f7ec34d86f015ab9b0384ec44af05cc9f9aaa64a Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 20 Dec 2024 10:15:01 +0100 Subject: [PATCH] fix: pass correct location data to session storage --- components/Forms/BookingWidget/FormContent/Search/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Forms/BookingWidget/FormContent/Search/index.tsx b/components/Forms/BookingWidget/FormContent/Search/index.tsx index cc9c7b275..061646635 100644 --- a/components/Forms/BookingWidget/FormContent/Search/index.tsx +++ b/components/Forms/BookingWidget/FormContent/Search/index.tsx @@ -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") {