Skip to content

Commit 1ca8aa7

Browse files
authored
Merge pull request #74 from gets0ul/community_app-issue_2695
Fix for community-app issue #2695
2 parents 3a520ff + cdf0eee commit 1ca8aa7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/actions/challenge-listing.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function getAll(getter, page = 0, prev) {
6868
} else {
6969
current = res;
7070
}
71-
return getAll(getter, 1 + page, current);
71+
return page === 0 ? current : getAll(getter, 1 + page, current);
7272
});
7373
}
7474

@@ -195,10 +195,9 @@ function getActiveChallengesDone(
195195
user = decodeToken(tokenV3).handle;
196196
// Handle any errors on this endpoint so that the non-user specific challenges
197197
// will still be loaded.
198-
calls.push(service.getUserChallenges(user, filter, {
199-
limit: PAGE_SIZE,
200-
offset: page * PAGE_SIZE,
201-
}).catch(() => ({ challenges: [] })));
198+
calls.push(getAll(
199+
params => service.getUserChallenges(user, filter, params).catch(() => ({ challenges: [] })),
200+
));
202201
}
203202
return Promise.all(calls).then(([ch, uch]) => {
204203
// let fullCH = ch;

0 commit comments

Comments
 (0)