mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
web: fix destructuring error if theme is undefined
This commit is contained in:
parent
38ce64b310
commit
fc26032048
|
@ -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