stop loader timeout if not loading #1795

Merged
neb-b merged 1 commit from subscriptions-loader into master 2018-07-20 20:56:47 +02:00
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; const { loading } = this.props;
if (!this.loaderTimeout && !prevProps.loading && loading) { if (!this.loaderTimeout && !prevProps.loading && loading) {
this.beginLoadingTimeout(); this.beginLoadingTimeout();
} else if (!loading && this.loaderTimeout) {
clearTimeout(this.loaderTimeout);
} }
} }

View file

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