diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 8f87c575e904d455e108324d15c96fe778a1fc45..e0be87b25bcef93d35a84b2ddc868b8a75ec164d 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -78,11 +78,11 @@ class Analysis extends Component { dispatch({ type: 'chart/fetch', }); - setTimeout(() => { + this.timeoutId = setTimeout(() => { this.setState({ loading: false, }); - }, 1000); + }, 600); }); } @@ -92,6 +92,7 @@ class Analysis extends Component { type: 'chart/clear', }); cancelAnimationFrame(this.reqRef); + clearTimeout(this.timeoutId); } handleChangeSalesType = e => { diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js index fbbdb7bb1143b21351a8e8be08a897900e363fff..71fc638465abe7c176d02cd014c2eb1e6878f7a1 100644 --- a/src/pages/Dashboard/Monitor.js +++ b/src/pages/Dashboard/Monitor.js @@ -18,7 +18,7 @@ const targetTime = new Date().getTime() + 3900000; // use permission as a parameter const havePermissionAsync = new Promise(resolve => { // Call resolve on behalf of passed - setTimeout(() => resolve(), 100); + setTimeout(() => resolve(), 300); }); @Secured(havePermissionAsync) @connect(({ monitor, loading }) => ({