Skip to content

fix: for issue #4964 #4989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/shared/components/challenge-listing/Listing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function Listing({
expandTag,
// pastSearchTimestamp,
isLoggedIn,
meta,
}) {
// const buckets = getBuckets(userChallenges);
// const isChallengesAvailable = (bucket) => {
Expand All @@ -78,6 +79,7 @@ function Listing({
let loadMore;
// let searchTimestamp;
let bucketChallenges = [];
let newExpanded = expanded;
switch (bucket) {
// case BUCKETS.PAST:
// keepPlaceholders = keepPastPlaceholders;
Expand All @@ -90,16 +92,19 @@ function Listing({
bucketChallenges = [].concat(myChallenges);
loading = loadingMyChallenges;
loadMore = allMyChallengesLoaded ? null : loadMoreMy;
newExpanded = newExpanded || (+meta.myChallengesCount === bucketChallenges.length);
break;
case BUCKETS.OPEN_FOR_REGISTRATION:
bucketChallenges = [].concat(openForRegistrationChallenges);
loading = loadingOpenForRegistrationChallenges;
loadMore = allOpenForRegistrationChallengesLoaded ? null : loadMoreOpenForRegistration;
newExpanded = newExpanded || (+meta.openChallengesCount === bucketChallenges.length);
break;
case BUCKETS.ONGOING:
bucketChallenges = [].concat(challenges);
loading = loadingOnGoingChallenges;
loadMore = allActiveChallengesLoaded ? null : loadMoreOnGoing;
newExpanded = newExpanded || (+meta.ongoingChallengesCount === bucketChallenges.length);
break;
default:
break;
Expand Down Expand Up @@ -137,7 +142,7 @@ function Listing({
challengesUrl={challengesUrl}
communityName={communityName}
expand={() => selectBucket(bucket)}
expanded={expanded}
expanded={newExpanded}
expandedTags={expandedTags}
expandTag={expandTag}
filterState={filterState}
Expand Down Expand Up @@ -268,6 +273,7 @@ Listing.propTypes = {
// pastSearchTimestamp: PT.number,
// userChallenges: PT.arrayOf(PT.string),
isLoggedIn: PT.bool.isRequired,
meta: PT.shape().isRequired,
};

const mapStateToProps = (state) => {
Expand Down
3 changes: 3 additions & 0 deletions src/shared/components/challenge-listing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default function ChallengeListing(props) {
preListingMsg,
// isBucketSwitching,
isLoggedIn,
meta,
} = props;

// const { challenges } = props;
Expand Down Expand Up @@ -131,6 +132,7 @@ export default function ChallengeListing(props) {
// loadingActiveChallenges={props.loadingChallenges}
// userChallenges={props.userChallenges}
isLoggedIn={isLoggedIn}
meta={meta}
/>
);
// }
Expand Down Expand Up @@ -236,4 +238,5 @@ ChallengeListing.propTypes = {
// isBucketSwitching: PT.bool,
// userChallenges: PT.arrayOf(PT.string),
isLoggedIn: PT.bool.isRequired,
meta: PT.shape().isRequired,
};
6 changes: 4 additions & 2 deletions src/shared/containers/challenge-listing/Listing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export class ListingContainer extends React.Component {
hideTcLinksInSidebarFooter,
// isBucketSwitching,
// userChallenges,
meta,
} = this.props;

const { tokenV3 } = auth;
Expand Down Expand Up @@ -530,6 +531,7 @@ export class ListingContainer extends React.Component {
// isBucketSwitching={isBucketSwitching}
// userChallenges={[]}
isLoggedIn={isLoggedIn}
meta={meta}
/>
</div>
);
Expand All @@ -555,7 +557,7 @@ ListingContainer.defaultProps = {
preListingMsg: null,
prizeMode: 'money-usd',
queryBucket: BUCKETS.ALL,
// meta: {},
meta: {},
// isBucketSwitching: false,
// userChallenges: [],
};
Expand Down Expand Up @@ -637,7 +639,7 @@ ListingContainer.propTypes = {
expandedTags: PT.arrayOf(PT.number).isRequired,
expandTag: PT.func.isRequired,
queryBucket: PT.string,
// meta: PT.shape(),
meta: PT.shape(),
// isBucketSwitching: PT.bool,
selectBucketDone: PT.func.isRequired,
getTotalChallengesCount: PT.func.isRequired,
Expand Down