Commit 7c18b657 authored by afc163's avatar afc163

tweak loading timeout

parent 88b85407
...@@ -78,11 +78,11 @@ class Analysis extends Component { ...@@ -78,11 +78,11 @@ class Analysis extends Component {
dispatch({ dispatch({
type: 'chart/fetch', type: 'chart/fetch',
}); });
setTimeout(() => { this.timeoutId = setTimeout(() => {
this.setState({ this.setState({
loading: false, loading: false,
}); });
}, 1000); }, 600);
}); });
} }
...@@ -92,6 +92,7 @@ class Analysis extends Component { ...@@ -92,6 +92,7 @@ class Analysis extends Component {
type: 'chart/clear', type: 'chart/clear',
}); });
cancelAnimationFrame(this.reqRef); cancelAnimationFrame(this.reqRef);
clearTimeout(this.timeoutId);
} }
handleChangeSalesType = e => { handleChangeSalesType = e => {
......
...@@ -18,7 +18,7 @@ const targetTime = new Date().getTime() + 3900000; ...@@ -18,7 +18,7 @@ const targetTime = new Date().getTime() + 3900000;
// use permission as a parameter // use permission as a parameter
const havePermissionAsync = new Promise(resolve => { const havePermissionAsync = new Promise(resolve => {
// Call resolve on behalf of passed // Call resolve on behalf of passed
setTimeout(() => resolve(), 100); setTimeout(() => resolve(), 300);
}); });
@Secured(havePermissionAsync) @Secured(havePermissionAsync)
@connect(({ monitor, loading }) => ({ @connect(({ monitor, loading }) => ({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment