From 5d7f6bf6edec2fd8a423da0fa6f7258220c719f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 13 Nov 2015 16:51:31 +0100 Subject: [PATCH] Fix redirect on email submission --- .../prize/portfolioreview/components/pr_landing.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js b/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js index 739f2b49..cdada68b 100644 --- a/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js +++ b/js/components/whitelabel/prize/portfolioreview/components/pr_landing.js @@ -17,7 +17,11 @@ import UserActions from '../../../../../actions/user_actions'; import { mergeOptions } from '../../../../../utils/general_utils'; import { getLangText } from '../../../../../utils/lang_utils'; + const PRLanding = React.createClass({ + propTypes: { + location: React.PropTypes.object + }, mixins: [History], @@ -29,10 +33,17 @@ const PRLanding = React.createClass({ }, componentDidMount() { + const { location } = this.props; UserStore.listen(this.onChange); UserActions.fetchCurrentUser(); PrizeStore.listen(this.onChange); PrizeActions.fetchPrize(); + + if(location && location.query && location.query.redirect) { + let queryCopy = JSON.parse(JSON.stringify(location.query)); + delete queryCopy.redirect; + window.setTimeout(() => this.history.replaceState(null, `/${location.query.redirect}`, queryCopy)); + } }, componentWillUnmount() {