Skip to content

Commit 8ac0de2

Browse files
committed
fix: no challenges found for logged in
1 parent 847a6fe commit 8ac0de2

File tree

2 files changed

+9
-2
lines changed
  • src/shared

2 files changed

+9
-2
lines changed

src/shared/components/challenge-listing/Listing/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.challengeCardContainer {
44
border-radius: $corner-radius;
55
width: 76.5%;
6+
margin-left: auto;
67

78
@include xs-to-md {
89
width: 100%;

src/shared/containers/challenge-listing/Listing/index.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

818820
const 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

Comments
 (0)