From 2f890d67e7a0502d4d7bda737554b61a2fea884c Mon Sep 17 00:00:00 2001 From: narekcat Date: Wed, 23 Sep 2020 14:00:39 +0400 Subject: [PATCH 1/2] fix: for issue #4784 --- src/shared/containers/terms-detail/index.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/shared/containers/terms-detail/index.jsx b/src/shared/containers/terms-detail/index.jsx index 0f79a1a904..f6b4cd93c5 100644 --- a/src/shared/containers/terms-detail/index.jsx +++ b/src/shared/containers/terms-detail/index.jsx @@ -70,9 +70,15 @@ class TermsDetailPageContainer extends React.Component { agreeingTerm, agreeTermFailure, theme, + history, } = this.props; const { termsAccepted, showModal } = this.state; + if (details && details.isLegacyTerm && !history.location.pathname.includes(details.id)) { + history.location.pathname = `/challenges/terms/detail/${details.id}`; // eslint-disable-line no-param-reassign + history.push(history.location.pathname, history.state); + } + return (
{ @@ -196,6 +202,7 @@ TermsDetailPageContainer.propTypes = { 'terms-title': PT.string.isRequired, modalMsg: PT.any, }).isRequired, + history: PT.shape().isRequired, }; function mapStateToProps(state, props) { From 904be2390daccb1d2da7fafcc279179ff4b61782 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Wed, 23 Sep 2020 21:34:43 -0300 Subject: [PATCH 2/2] Terms: removed unnecessary reassign --- src/shared/containers/terms-detail/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/containers/terms-detail/index.jsx b/src/shared/containers/terms-detail/index.jsx index f6b4cd93c5..3bc8897294 100644 --- a/src/shared/containers/terms-detail/index.jsx +++ b/src/shared/containers/terms-detail/index.jsx @@ -75,8 +75,8 @@ class TermsDetailPageContainer extends React.Component { const { termsAccepted, showModal } = this.state; if (details && details.isLegacyTerm && !history.location.pathname.includes(details.id)) { - history.location.pathname = `/challenges/terms/detail/${details.id}`; // eslint-disable-line no-param-reassign - history.push(history.location.pathname, history.state); + const path = `/challenges/terms/detail/${details.id}`; + history.push(path, history.state); } return (