File tree Expand file tree Collapse file tree
src/components/HOCs/WithReviewTasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,12 +249,20 @@ export const WithReviewTasks = function (WrappedComponent) {
249249
250250 const criteria =
251251 this . state . criteria [ this . props . reviewTasksType ] || this . buildDefaultCriteria ( this . props ) ;
252- const projectId = this . state . criteria [ this . props . reviewTasksType ] ?. filters ?. projectId ;
252+ const projectIdFilter = this . state . criteria [ this . props . reviewTasksType ] ?. filters ?. projectId ;
253253
254- // Filter available challenges to ones in selected project if applicable
255- const reviewChallenges = ! projectId
254+ // Filter available challenges to ones in selected project(s) if applicable
255+ const selectedProjectIds = Array . isArray ( projectIdFilter )
256+ ? projectIdFilter
257+ : projectIdFilter
258+ ? [ projectIdFilter ]
259+ : [ ] ;
260+
261+ const reviewChallenges = ! selectedProjectIds . length
256262 ? this . props . currentReviewTasks . reviewChallenges
257- : _filter ( this . props . currentReviewTasks . reviewChallenges , ( c ) => c . parent === projectId ) ;
263+ : _filter ( this . props . currentReviewTasks . reviewChallenges , ( challenge ) =>
264+ selectedProjectIds . includes ( challenge . parent ) ,
265+ ) ;
258266
259267 return (
260268 < WrappedComponent
You can’t perform that action at this time.
0 commit comments