Skip to content

Commit d00194c

Browse files
committed
Revert "fix: no challenges found"
This reverts commit 847a6fe.
1 parent db7596b commit d00194c

File tree

2 files changed

+7
-14
lines changed
  • src/shared
    • components/challenge-listing/Listing
    • containers/challenge-listing/Listing

2 files changed

+7
-14
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import CardPlaceholder from '../placeholders/ChallengeCard';
1717
import './style.scss';
1818

1919
// const Filter = challengeUtils.filter;
20-
const LOADING_MESSAGE = 'Loading Challenges';
2120

2221
function Listing({
2322
activeBucket,
@@ -259,14 +258,7 @@ function Listing({
259258
loading
260259
? placeholders
261260
: (!filterState.recommended || activeBucket !== 'openForRegistration') && (
262-
<div styleName="no-results">
263-
{
264-
needLoad ? LOADING_MESSAGE
265-
: (
266-
`${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}`
267-
)
268-
}
269-
</div>
261+
<div styleName="no-results">{ `${NO_LIVE_CHALLENGES_CONFIG[activeBucket]}` }</div>
270262
)
271263
}
272264
</div>

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export class ListingContainer extends React.Component {
6666
filter,
6767
} = this.props;
6868

69+
const { needLoad } = this.state;
70+
6971
markHeaderMenu();
7072

7173
if (queryBucket !== activeBucket && _.includes(BUCKETS, queryBucket)) {
@@ -105,6 +107,10 @@ export class ListingContainer extends React.Component {
105107
});
106108
}
107109
// }
110+
111+
if (needLoad) {
112+
this.setState({ needLoad: false });
113+
}
108114
}
109115

110116
componentDidUpdate(prevProps) {
@@ -134,7 +140,6 @@ export class ListingContainer extends React.Component {
134140
getPastChallenges,
135141
filterState,
136142
} = this.props;
137-
const { needLoad } = this.state;
138143
const oldUserId = _.get(prevProps, 'auth.user.userId');
139144
const userId = _.get(this.props, 'auth.user.userId');
140145
const handle = _.get(auth, 'user.handle');
@@ -259,10 +264,6 @@ export class ListingContainer extends React.Component {
259264
}
260265
if (filterChanged(filter, prevProps.filter)) {
261266
this.reloadChallenges();
262-
if (needLoad) {
263-
// eslint-disable-next-line react/no-did-update-set-state
264-
this.setState({ needLoad: false });
265-
}
266267
}
267268
setTimeout(() => {
268269
selectBucketDone();

0 commit comments

Comments
 (0)