Skip to content

Commit

Permalink
Fix visibility of nearcon banner
Browse files Browse the repository at this point in the history
  • Loading branch information
shelegdmitriy committed Aug 29, 2023
1 parent dc58aa1 commit a05b8d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/useBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ export function useBanner() {
const [isBannerVisible, setBanner] = useState<boolean>(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);
}, []);

Expand Down

0 comments on commit a05b8d3

Please sign in to comment.