Skip to content

fix for issue #4435 #4465

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
Jun 4, 2020
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
14 changes: 8 additions & 6 deletions src/shared/containers/challenge-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ class ChallengeDetailPageContainer extends React.Component {
reviewTypes,
getAllCountries,
getReviewTypes,
history,
} = this.props;

if (
Expand All @@ -192,7 +191,7 @@ class ChallengeDetailPageContainer extends React.Component {
&& !challenge.fetchedWithAuth)

) {
loadChallengeDetails(auth, challengeId, history);
loadChallengeDetails(auth, challengeId);
}

if (!allCountries.length) {
Expand All @@ -219,8 +218,14 @@ class ChallengeDetailPageContainer extends React.Component {
auth,
challenge,
loadingRecommendedChallengesUUID,
history,
} = this.props;

if (challenge.isLegacyChallenge && !history.location.pathname.includes(challenge.id)) {
history.location.pathname = `/challenges/${challenge.id}`; // eslint-disable-line no-param-reassign
history.push(history.location.pathname, history.state);
}

const recommendedTechnology = getRecommendedTags(challenge);
if (
challenge
Expand Down Expand Up @@ -843,15 +848,12 @@ const mapDispatchToProps = (dispatch) => {
dispatch(lookupActions.getReviewTypesInit());
dispatch(lookupActions.getReviewTypesDone(tokenV3));
},
loadChallengeDetails: (tokens, challengeId, history) => {
loadChallengeDetails: (tokens, challengeId) => {
const a = actions.challenge;
dispatch(a.getDetailsInit(challengeId));
dispatch(a.getDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2))
.then((res) => {
const ch = res.payload;
if (ch.isLegacyChallenge) {
history.location.pathname = `/challenges/${ch.id}`; // eslint-disable-line no-param-reassign
}
if (ch.track === 'DESIGN') {
const p = ch.allPhases || ch.phases || []
.filter(x => x.name === 'Checkpoint Review');
Expand Down