Skip to content

Commit

Permalink
fix: themes wont save
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyphyn committed Mar 5, 2024
1 parent 9d8a7f6 commit d42a9e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/ui/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ export const colorToVar = (category: keyof Colors, shade: keyof keyof Colors): s

function loadColors() {
const loaded = localStorage.getItem('colors')
if (!loaded) return
colors.set(JSON.parse(loaded))
if (loaded) {
colors.set(JSON.parse(loaded))
}
colors.subscribe((v) => {
localStorage.setItem('colors', JSON.stringify(v))
})
Expand Down

0 comments on commit d42a9e1

Please sign in to comment.