This is an automated email from the ASF dual-hosted git repository.

xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 09774f6  Issue fixed by changing the homepage  componentDidMount() 
(#185)
09774f6 is described below

commit 09774f6a4c3fee11feb05c00383d439e6a72ca1a
Author: Kaveesha Dinamidu <[email protected]>
AuthorDate: Wed Feb 23 08:53:17 2022 +0530

    Issue fixed by changing the homepage  componentDidMount() (#185)
---
 src/routes/Home/index.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/routes/Home/index.js b/src/routes/Home/index.js
index 3c0f1c1..5699196 100644
--- a/src/routes/Home/index.js
+++ b/src/routes/Home/index.js
@@ -33,10 +33,13 @@ export default class Home extends Component {
   }
 
   componentDidMount() {
-    const { dispatch } = this.props;
-    dispatch({
-      type: "global/fetchPlatform"
-    });
+    const token = window.sessionStorage.getItem("token");
+    if (token) {
+      const { dispatch } = this.props;
+      dispatch({
+        type: "global/fetchPlatform"
+      });
+    }
   }
 
   changeLocales(locale) {

Reply via email to