Skip to content

Commit 97df7b5

Browse files
authored
Merge pull request #228 from cagdas001/integration-v5-challenge-api
fix(challenge-utils): update `filterByUsers` to use `userId`
2 parents 7c73648 + cf892ff commit 97df7b5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utils/challenge/filter.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ function filterByUpcoming(challenge, state) {
173173
}
174174

175175
function filterByUsers(challenge, state) {
176-
if (!state.userChallenges) return true;
177-
return state.userChallenges.find(ch => challenge.id === ch);
176+
const userId = _.get(state, 'userId', null);
177+
if (userId) {
178+
return _.get(challenge, ['users', userId], false);
179+
}
180+
return true;
178181
}
179182

180183
/**

0 commit comments

Comments
 (0)