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>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
let settings = localStorage.getItem('settings'), theme;
|
let settings = localStorage.getItem('settings'), appearance;
|
||||||
if (settings && ({ theme } = JSON.parse(settings)?.appearance)) {
|
if (settings && ({ appearance } = JSON.parse(settings)) && appearance?.theme) {
|
||||||
document.body.id = `body-${theme}`;
|
document.body.id = `body-${appearance.theme}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue