From 64ca2ff19c06a214dbf95ff249a3b5c7b36d4f16 Mon Sep 17 00:00:00 2001 From: Narek Vardzelyan Date: Thu, 11 Jun 2020 18:44:36 +0400 Subject: [PATCH] fix: issue #4438 --- src/shared/utils/challenge-detail/helper.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/shared/utils/challenge-detail/helper.jsx b/src/shared/utils/challenge-detail/helper.jsx index 7f379b7472..3f45591edf 100644 --- a/src/shared/utils/challenge-detail/helper.jsx +++ b/src/shared/utils/challenge-detail/helper.jsx @@ -202,14 +202,13 @@ export function getDisplayRecommendedChallenges( const displayRecommendedChallenges = recommendedChallenges[recommendedTag] ? recommendedChallenges[recommendedTag].challenges : []; const filterParams = getBuckets(null)[BUCKETS.OPEN_FOR_REGISTRATION].filter; - const userHandle = _.get(auth.user, 'handle'); + const userId = _.get(auth.user, 'userId'); const filter = Filter.getFilterFunction(filterParams); let results = _.filter(displayRecommendedChallenges, (c) => { let isValid = filter(c); - if (isValid && userHandle) { - // TODO: Find equivalent of !c.users[userHandle] - isValid = c.id !== challenge.id; + if (isValid && userId) { + isValid = !c.users[userId] && c.id !== challenge.id; } return isValid; });