stop loader timeout if not loading

This commit is contained in:
Sean Yesmunt 2018-07-20 13:48:31 -04:00
parent 402e63d27f
commit 90655a1dd5
2 changed files with 3 additions and 1 deletions

View file

@ -41,6 +41,8 @@ class Page extends React.PureComponent<Props, State> {
const { loading } = this.props;
if (!this.loaderTimeout && !prevProps.loading && loading) {
this.beginLoadingTimeout();
} else if (!loading && this.loaderTimeout) {
clearTimeout(this.loaderTimeout);
}
}

View file

@ -13,7 +13,7 @@ import SubscriptionsPage from './view';
const select = state => ({
loading:
selectIsFetchingSubscriptions(state) ||
Object.keys(selectSubscriptionsBeingFetched(state)).length,
Boolean(Object.keys(selectSubscriptionsBeingFetched(state)).length),
subscriptionsBeingFetched: selectSubscriptionsBeingFetched(state),
subscriptions: selectSubscriptions(state),
subscriptionClaims: selectSubscriptionClaims(state),