Browse Source

Fixed slow response time of diskprop theme loadin

Toby Chui 1 year ago
parent
commit
257947fd09
1 changed files with 10 additions and 11 deletions
  1. 10 11
      web/SystemAO/disk/diskprop.html

+ 10 - 11
web/SystemAO/disk/diskprop.html

@@ -203,6 +203,16 @@
             init();
         }
         
+        //Initialize system theme
+        loadPreference("file_explorer/theme",function(data){
+            if (data.error === undefined){
+                if (data == "darkTheme"){
+                    $("body").addClass("darkTheme");
+                }else{
+                    $("body").addClass("whiteTheme");
+                }
+            }
+        });
 
        function init(){
             //There are something to load. Load the vroot properties
@@ -293,17 +303,6 @@
                 success: function(data){
                     callback(data);
                     fileInfo = data;
-                    //Initialize system theme
-                    loadPreference("file_explorer/theme",function(data){
-                        if (data.error === undefined){
-                            if (data == "darkTheme"){
-                                $("body").addClass("darkTheme");
-                            }else{
-                                $("body").addClass("whiteTheme");
-                            }
-                        }
-                    });
-
                 }
             })  
         }