web: fix destructuring error if theme is undefined

This commit is contained in:
dumbmoron 2024-09-03 13:04:12 +00:00
parent 38ce64b310
commit fc26032048
No known key found for this signature in database

View file

@ -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>