Skip to content

Commit

Permalink
Handle old theme localStorage object into new theme string
Browse files Browse the repository at this point in the history
  • Loading branch information
SayakMukhopadhyay committed Apr 23, 2021
1 parent babffb0 commit 415f099
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export default {
},
beforeMount () {
try {
const stored = localStorage.getItem('theme')
let stored = localStorage.getItem('theme')
if (stored !== 'light' && stored !== 'dark') { // Fix for moving from old theme object to new theme string
stored = null
}
if (stored) {
this.theme = stored
} else {
Expand Down

0 comments on commit 415f099

Please sign in to comment.