
let obj = !localStorage ? {id: 'theme-light', type: 'light'} : JSON.parse(localStorage.getItem("ui-theme"));
if ( !obj ) {
    if ( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ) {
        obj = {id: 'theme-dark', type: 'dark'};
        localStorage && localStorage.setItem("ui-theme", JSON.stringify(obj));
    }
}

document.body.classList.add(`theme-type-${obj.type}`);

@@ -121,20 +121,21 @@
 ) %7B%0A    
-if (
+obj =
  window.
@@ -206,19 +206,17 @@
 matches 
-) %7B
+?
 %0A       
@@ -216,21 +216,23 @@
         
-obj =
+       
  %7Bid: 't
@@ -256,22 +256,55 @@
  'dark'%7D
-;%0A    
+ : %7Bid: 'theme-light', type: 'light'%7D;%0A
     loca
@@ -374,14 +374,8 @@
 ));%0A
-    %7D%0A
 %7D%0A%0Ad

fix bug 55103