@@ -166,6 +166,7 @@ class ChallengeDetailPageContainer extends React.Component {
166
166
reviewTypes,
167
167
getAllCountries,
168
168
getReviewTypes,
169
+ history,
169
170
} = this . props ;
170
171
171
172
if (
@@ -191,7 +192,7 @@ class ChallengeDetailPageContainer extends React.Component {
191
192
&& ! challenge . fetchedWithAuth )
192
193
193
194
) {
194
- loadChallengeDetails ( auth , challengeId ) ;
195
+ loadChallengeDetails ( auth , challengeId , history ) ;
195
196
}
196
197
197
198
if ( ! allCountries . length ) {
@@ -706,6 +707,7 @@ ChallengeDetailPageContainer.propTypes = {
706
707
expandedTags : PT . arrayOf ( PT . number ) . isRequired ,
707
708
expandTag : PT . func . isRequired ,
708
709
loadingRecommendedChallengesUUID : PT . string . isRequired ,
710
+ history : PT . shape ( ) . isRequired ,
709
711
} ;
710
712
711
713
function mapStateToProps ( state , props ) {
@@ -841,12 +843,15 @@ const mapDispatchToProps = (dispatch) => {
841
843
dispatch ( lookupActions . getReviewTypesInit ( ) ) ;
842
844
dispatch ( lookupActions . getReviewTypesDone ( tokenV3 ) ) ;
843
845
} ,
844
- loadChallengeDetails : ( tokens , challengeId ) => {
846
+ loadChallengeDetails : ( tokens , challengeId , history ) => {
845
847
const a = actions . challenge ;
846
848
dispatch ( a . getDetailsInit ( challengeId ) ) ;
847
849
dispatch ( a . getDetailsDone ( challengeId , tokens . tokenV3 , tokens . tokenV2 ) )
848
850
. then ( ( res ) => {
849
851
const ch = res . payload ;
852
+ if ( ch . isLegacyChallenge ) {
853
+ history . location . pathname = `/challenges/${ ch . id } ` ; // eslint-disable-line no-param-reassign
854
+ }
850
855
if ( ch . track === 'DESIGN' ) {
851
856
const p = ch . allPhases || ch . phases || [ ]
852
857
. filter ( x => x . name === 'Checkpoint Review' ) ;
0 commit comments