Skip to content

Commit

Permalink
web: fix destructuring error if theme is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmoron committed Sep 3, 2024
1 parent 38ce64b commit fc26032
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
let settings = localStorage.getItem('settings'), theme;
if (settings && ({ theme } = JSON.parse(settings)?.appearance)) {
document.body.id = `body-${theme}`;
let settings = localStorage.getItem('settings'), appearance;
if (settings && ({ appearance } = JSON.parse(settings)) && appearance?.theme) {
document.body.id = `body-${appearance.theme}`;
}
});
</script>
Expand Down

0 comments on commit fc26032

Please sign in to comment.