Skip to content

Commit 4c6c140

Browse files
authored
Merge pull request #4522 from narekcat/issue4438
fix: issue #4438
2 parents bd29bf9 + 64ca2ff commit 4c6c140

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/shared/utils/challenge-detail/helper.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,13 @@ export function getDisplayRecommendedChallenges(
202202
const displayRecommendedChallenges = recommendedChallenges[recommendedTag]
203203
? recommendedChallenges[recommendedTag].challenges : [];
204204
const filterParams = getBuckets(null)[BUCKETS.OPEN_FOR_REGISTRATION].filter;
205-
const userHandle = _.get(auth.user, 'handle');
205+
const userId = _.get(auth.user, 'userId');
206206
const filter = Filter.getFilterFunction(filterParams);
207207

208208
let results = _.filter(displayRecommendedChallenges, (c) => {
209209
let isValid = filter(c);
210-
if (isValid && userHandle) {
211-
// TODO: Find equivalent of !c.users[userHandle]
212-
isValid = c.id !== challenge.id;
210+
if (isValid && userId) {
211+
isValid = !c.users[userId] && c.id !== challenge.id;
213212
}
214213
return isValid;
215214
});

0 commit comments

Comments
 (0)