Skip to content

Commit

Permalink
🐛 Fix persistence when user selects system color mode
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Aug 31, 2023
1 parent 6207edf commit ce9ad8b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export const UserPreferencesForm = () => {
}

const changeAppearance = async (value: string) => {
setColorMode(value)
if (value === 'system') {
setColorMode('system')
localStorage.removeItem('chakra-ui-color-mode')
} else setColorMode(value)
updateUser({ preferredAppAppearance: value })
}

Expand Down

0 comments on commit ce9ad8b

Please sign in to comment.