From a05b8d393eb773c6b1e7c30f9b834020372cee3f Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Tue, 29 Aug 2023 21:13:59 +0300 Subject: [PATCH] Fix visibility of nearcon banner --- src/hooks/useBanner.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useBanner.ts b/src/hooks/useBanner.ts index 1ce57e9bf..b158b2e18 100644 --- a/src/hooks/useBanner.ts +++ b/src/hooks/useBanner.ts @@ -7,13 +7,14 @@ export function useBanner() { const [isBannerVisible, setBanner] = useState(true); useEffect(() => { - const bannerState = sessionStorage.getItem('hintVisible'); + const bannerState = localStorage.getItem('hintVisible'); + console.log("bannerState: ", bannerState); const banner = bannerState ? JSON.parse(bannerState) : true; setBanner(banner); }, []); const setBanners = useCallback((newBannerState: boolean) => { - sessionStorage.setItem('hintVisible', JSON.stringify(newBannerState)); + localStorage.setItem('hintVisible', JSON.stringify(newBannerState)); setBanner(newBannerState); }, []);