Skip to content

Commit b0f737e

Browse files
committed
fix for issue #4435
1 parent 35e60aa commit b0f737e

File tree

1 file changed

+4
-6
lines changed
  • src/shared/containers/challenge-detail

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 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, this.props.history);
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) {
@@ -847,12 +849,8 @@ const mapDispatchToProps = (dispatch) => {
847849
dispatch(a.getDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2))
848850
.then((res) => {
849851
const ch = res.payload;
850-
console.log(`found challenge details: ${JSON.stringify(ch)}`);
851852
if (ch.isLegacyChallenge) {
852-
console.log(`redirecting to /challenges/${ch.id}`);
853-
console.log(`history ${JSON.stringify(history)}`);
854-
// history.push(`/challenges/${ch.id}`);
855-
// history.pushState({}, null, `/challenges/${ch.id}`);
853+
history.location.pathname = `/challenges/${ch.id}`; // eslint-disable-line no-param-reassign
856854
}
857855
if (ch.track === 'DESIGN') {
858856
const p = ch.allPhases || ch.phases || []

0 commit comments

Comments
 (0)