From ba4d6e414fbb37121e80815d3f5ab1aca7a60b08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 28 十月 2024 13:59:34 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/home/index.jsx |   56 +++++++++++++++++++++++++-------------------------------
 1 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/src/tabviews/home/index.jsx b/src/tabviews/home/index.jsx
index a6a8a60..5dafb3f 100644
--- a/src/tabviews/home/index.jsx
+++ b/src/tabviews/home/index.jsx
@@ -39,11 +39,11 @@
   check = (times) => {
     times++
 
-    if ((window.GLOB.mkThdMenus.length > 0 && window.GLOB.mkActions.loaded) || times > 50) {
+    if ((window.GLOB.mkThdMenus.size > 0 && window.GLOB.mkActions.loaded) || times > 50) {
       this.setState({
         waiting: false
       })
-    } else {
+    } else if (!window.GLOB.$error) {
       setTimeout(() => {
         this.check(times)
       }, 200)
@@ -56,42 +56,36 @@
       MenuID: this.props.MenuID
     }
     Api.getCacheConfig(_param).then(result => {
-      if (result.status) {
-        if (result.LongParam) {
-          let config = ''
+      let view = 'default'
+      if (result.status && result.LongParam) {
+        let config = ''
 
-          try { // 閰嶇疆淇℃伅瑙f瀽
-            config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
-          } catch (e) {
-            console.warn('Parse Failure')
-            config = ''
-          }
-
-          if (!config || !config.enabled) {
-            this.setState({
-              loading: false,
-              waiting: false,
-              view: 'default'
-            })
-          } else {
-            this.setState({
-              loading: false,
-              view: 'custom'
-            })
-          }
-        } else {
-          this.setState({
-            loading: false,
-            waiting: false,
-            view: 'default'
-          })
+        try { // 閰嶇疆淇℃伅瑙f瀽
+          config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
+        } catch (e) {
+          console.warn('Parse Failure')
+          config = ''
         }
-      } else {
+
+        if (config && config.enabled) {
+          view = 'custom'
+        }
+      }
+
+      if (view === 'default') {
         this.setState({
           loading: false,
           waiting: false,
           view: 'default'
         })
+      } else {
+        this.setState({
+          loading: false,
+          view: 'custom'
+        })
+      }
+
+      if (!result.status) {
         notification.warning({
           top: 92,
           message: result.message,

--
Gitblit v1.8.0