Skip to content

fix: support old mm challenge, get challenge by roundId #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/reducers/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,18 @@ function onGetDetailsDone(state, action) {
// condition based on ROUTE used for Review Opportunities, change if needed
const challengeId = state.loadingDetailsForChallengeId;
let compareChallenge = details.id;
// to be compatible with old mm challenge, we should get legacyId from roundId firstly,
// like roundId '19038' to legacyId '30233148'
let isOldMmChallenge = false;
if (challengeId.length >= 5 && challengeId.length <= 8) {
compareChallenge = details.legacyId;

if (challengeId !== _.toString(compareChallenge)) {
isOldMmChallenge = true;
}
}

if (_.toString(compareChallenge) !== challengeId) {
if (!isOldMmChallenge && _.toString(compareChallenge) !== challengeId) {
return state;
}

Expand Down