Skip to content

Commit 7f36fd0

Browse files
committed
fix: support old mm challenge, get challenge by roundId
1 parent a406dfb commit 7f36fd0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/reducers/challenge.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,18 @@ function onGetDetailsDone(state, action) {
7676
// condition based on ROUTE used for Review Opportunities, change if needed
7777
const challengeId = state.loadingDetailsForChallengeId;
7878
let compareChallenge = details.id;
79+
// to be compatible with old mm challenge, we should get legacyId from roundId firstly,
80+
// like roundId '19038' to legacyId '30233148'
81+
let isOldMmChallenge = false;
7982
if (challengeId.length >= 5 && challengeId.length <= 8) {
8083
compareChallenge = details.legacyId;
84+
85+
if (challengeId !== _.toString(compareChallenge)) {
86+
isOldMmChallenge = true;
87+
}
8188
}
8289

83-
if (_.toString(compareChallenge) !== challengeId) {
90+
if (!isOldMmChallenge && _.toString(compareChallenge) !== challengeId) {
8491
return state;
8592
}
8693

0 commit comments

Comments
 (0)