From 77f223e0e27f25306319b71652006d1589c2b773 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 16 May 2019 16:53:47 +0800 Subject: [PATCH] remove useless state loading --- src/pages/Dashboard/Analysis.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 609bf199..82700135 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -18,7 +18,6 @@ const OfflineData = React.lazy(() => import('./OfflineData')); })) class Analysis extends Component { state = { - loading: true, salesType: 'all', currentTabKey: '', rangePickerValue: getTimeDistance('year'), @@ -31,11 +30,6 @@ class Analysis extends Component { type: 'chart/fetch', }); }); - setTimeout(() => { - this.setState({ - loading: false, - }); - }, 2000); } componentWillUnmount() { @@ -96,9 +90,8 @@ class Analysis extends Component { }; render() { - const { rangePickerValue, salesType, currentTabKey, loading: stateLoading } = this.state; - const { chart, loading: propsLoading } = this.props; - const loading = stateLoading || propsLoading; + const { rangePickerValue, salesType, currentTabKey } = this.state; + const { chart, loading } = this.props; const { visitData, visitData2, -- GitLab