mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Fix redirect on email submission
This commit is contained in:
parent
8b335cfb07
commit
5d7f6bf6ed
@ -17,7 +17,11 @@ import UserActions from '../../../../../actions/user_actions';
|
|||||||
import { mergeOptions } from '../../../../../utils/general_utils';
|
import { mergeOptions } from '../../../../../utils/general_utils';
|
||||||
import { getLangText } from '../../../../../utils/lang_utils';
|
import { getLangText } from '../../../../../utils/lang_utils';
|
||||||
|
|
||||||
|
|
||||||
const PRLanding = React.createClass({
|
const PRLanding = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
location: React.PropTypes.object
|
||||||
|
},
|
||||||
|
|
||||||
mixins: [History],
|
mixins: [History],
|
||||||
|
|
||||||
@ -29,10 +33,17 @@ const PRLanding = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
const { location } = this.props;
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
UserActions.fetchCurrentUser();
|
UserActions.fetchCurrentUser();
|
||||||
PrizeStore.listen(this.onChange);
|
PrizeStore.listen(this.onChange);
|
||||||
PrizeActions.fetchPrize();
|
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() {
|
componentWillUnmount() {
|
||||||
|
Loading…
Reference in New Issue
Block a user