Skip to content

Commit

Permalink
localStorage fix 6
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeBlanc committed Oct 7, 2023
1 parent 88c217e commit b07ad76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assignment-4/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function App() {
? 'dark'
: 'light'
const [currentTheme, setCurrentTheme] = useState(
typeof localStorage !== 'undefined' ? localStorage.getItem('theme') || systemTheme : systemTheme
typeof localStorage !== 'undefined'
? localStorage.getItem('theme') || systemTheme
: systemTheme,
)
useEffect(() => {
localStorage.setItem('theme', JSON.stringify(currentTheme))
Expand Down

1 comment on commit b07ad76

@vercel
Copy link

@vercel vercel bot commented on b07ad76 Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

assignment3 – ./assignment-3

assignment3-joeblanc.vercel.app
assignment3-git-main-joeblanc.vercel.app
assignment3-cyan.vercel.app

Please sign in to comment.