Merge pull request #1795 from lbryio/subscriptions-loader

stop loader timeout if not loading
This commit is contained in:
Sean Yesmunt 2018-07-20 14:56:47 -04:00 committed by GitHub
commit 9d939899d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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),