web: fix destructuring error if theme is undefined
This commit is contained in:
parent
38ce64b310
commit
fc26032048
1 changed files with 3 additions and 3 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue