Skip to content

Commit 11cf6fc

Browse files
authored
Merge pull request #4444 from simranb86/issue_4435_new
fix for issue #4435
2 parents a1f1951 + 05358ca commit 11cf6fc

File tree

1 file changed

+7
-2
lines changed
  • src/shared/containers/challenge-detail

1 file changed

+7
-2
lines changed

src/shared/containers/challenge-detail/index.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class ChallengeDetailPageContainer extends React.Component {
166166
reviewTypes,
167167
getAllCountries,
168168
getReviewTypes,
169+
history,
169170
} = this.props;
170171

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

193194
) {
194-
loadChallengeDetails(auth, challengeId);
195+
loadChallengeDetails(auth, challengeId, history);
195196
}
196197

197198
if (!allCountries.length) {
@@ -706,6 +707,7 @@ ChallengeDetailPageContainer.propTypes = {
706707
expandedTags: PT.arrayOf(PT.number).isRequired,
707708
expandTag: PT.func.isRequired,
708709
loadingRecommendedChallengesUUID: PT.string.isRequired,
710+
history: PT.shape().isRequired,
709711
};
710712

711713
function mapStateToProps(state, props) {
@@ -841,12 +843,15 @@ const mapDispatchToProps = (dispatch) => {
841843
dispatch(lookupActions.getReviewTypesInit());
842844
dispatch(lookupActions.getReviewTypesDone(tokenV3));
843845
},
844-
loadChallengeDetails: (tokens, challengeId) => {
846+
loadChallengeDetails: (tokens, challengeId, history) => {
845847
const a = actions.challenge;
846848
dispatch(a.getDetailsInit(challengeId));
847849
dispatch(a.getDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2))
848850
.then((res) => {
849851
const ch = res.payload;
852+
if (ch.isLegacyChallenge) {
853+
history.location.pathname = `/challenges/${ch.id}`; // eslint-disable-line no-param-reassign
854+
}
850855
if (ch.track === 'DESIGN') {
851856
const p = ch.allPhases || ch.phases || []
852857
.filter(x => x.name === 'Checkpoint Review');

0 commit comments

Comments
 (0)