@@ -133,8 +133,8 @@ export class ListingContainer extends React.Component {
133133 dropPastChallenges,
134134 getPastChallenges,
135135 filterState,
136+ loading,
136137 } = this . props ;
137- const { needLoad } = this . state ;
138138 const oldUserId = _ . get ( prevProps , 'auth.user.userId' ) ;
139139 const userId = _ . get ( this . props , 'auth.user.userId' ) ;
140140 const handle = _ . get ( auth , 'user.handle' ) ;
@@ -259,7 +259,7 @@ export class ListingContainer extends React.Component {
259259 }
260260 if ( filterChanged ( filter , prevProps . filter ) ) {
261261 this . reloadChallenges ( ) ;
262- if ( needLoad ) {
262+ if ( ! loading ) {
263263 // eslint-disable-next-line react/no-did-update-set-state
264264 this . setState ( { needLoad : false } ) ;
265265 }
@@ -714,6 +714,7 @@ ListingContainer.defaultProps = {
714714 queryBucket : BUCKETS . OPEN_FOR_REGISTRATION ,
715715 meta : { } ,
716716 expanding : false ,
717+ loading : false ,
717718 // isBucketSwitching: false,
718719 // userChallenges: [],
719720} ;
@@ -813,6 +814,7 @@ ListingContainer.propTypes = {
813814 // getUserChallenges: PT.func.isRequired,
814815 setSearchText : PT . func . isRequired ,
815816 filterState : PT . shape ( ) . isRequired ,
817+ loading : PT . bool ,
816818} ;
817819
818820const mapStateToProps = ( state , ownProps ) => {
@@ -873,6 +875,10 @@ const mapStateToProps = (state, ownProps) => {
873875 meta : cl . meta ,
874876 // userChallenges: cl.userChallenges,
875877 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 ,
876882 } ;
877883} ;
878884
0 commit comments