@@ -133,8 +133,8 @@ export class ListingContainer extends React.Component {
133
133
dropPastChallenges,
134
134
getPastChallenges,
135
135
filterState,
136
+ loading,
136
137
} = this . props ;
137
- const { needLoad } = this . state ;
138
138
const oldUserId = _ . get ( prevProps , 'auth.user.userId' ) ;
139
139
const userId = _ . get ( this . props , 'auth.user.userId' ) ;
140
140
const handle = _ . get ( auth , 'user.handle' ) ;
@@ -259,7 +259,7 @@ export class ListingContainer extends React.Component {
259
259
}
260
260
if ( filterChanged ( filter , prevProps . filter ) ) {
261
261
this . reloadChallenges ( ) ;
262
- if ( needLoad ) {
262
+ if ( ! loading ) {
263
263
// eslint-disable-next-line react/no-did-update-set-state
264
264
this . setState ( { needLoad : false } ) ;
265
265
}
@@ -714,6 +714,7 @@ ListingContainer.defaultProps = {
714
714
queryBucket : BUCKETS . OPEN_FOR_REGISTRATION ,
715
715
meta : { } ,
716
716
expanding : false ,
717
+ loading : false ,
717
718
// isBucketSwitching: false,
718
719
// userChallenges: [],
719
720
} ;
@@ -813,6 +814,7 @@ ListingContainer.propTypes = {
813
814
// getUserChallenges: PT.func.isRequired,
814
815
setSearchText : PT . func . isRequired ,
815
816
filterState : PT . shape ( ) . isRequired ,
817
+ loading : PT . bool ,
816
818
} ;
817
819
818
820
const mapStateToProps = ( state , ownProps ) => {
@@ -873,6 +875,10 @@ const mapStateToProps = (state, ownProps) => {
873
875
meta : cl . meta ,
874
876
// userChallenges: cl.userChallenges,
875
877
filterState : cl . filter ,
878
+ loading : Boolean ( cl . loadingActiveChallengesUUID )
879
+ || Boolean ( cl . loadingOpenForRegistrationChallengesUUID )
880
+ || Boolean ( cl . loadingMyChallengesUUID ) || Boolean ( cl . loadingAllChallengesUUID )
881
+ || Boolean ( cl . loadingPastChallengesUUID ) || cl . loadingReviewOpportunitiesUUID ,
876
882
} ;
877
883
} ;
878
884
0 commit comments