Skip to content

Commit

Permalink
fix: localStorage SSR check
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioriper authored and jshearer committed Nov 16, 2023
1 parent 4d26ac3 commit 5e068ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Footer from "./footer"
import TakeATour from "./TakeATour"

const Layout = ({headerTheme, showTour = false, children}: {headerTheme: "light"|"dark", showTour?: boolean, children: React.ReactNode|React.ReactNode[]}) => {
const [closeTour, setCloseTour] = React.useState(!!localStorage.getItem('@estuary/closeTour'))
const [closeTour, setCloseTour] = React.useState(typeof window !== 'undefined' && !!localStorage.getItem('@estuary/closeTour'))

return (
<div className="global-wrapper">
Expand Down

0 comments on commit 5e068ac

Please sign in to comment.