1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

Add awful hack to handle redirect on login and collection pages

This commit is contained in:
vrde 2015-07-14 23:11:23 +02:00
parent aec1ff2173
commit d093fe013c
2 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,8 @@ let LoginForm = React.createClass({
// if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email && this.props.redirectOnLoggedIn) {
this.transitionTo('pieces');
// FIXME: hack to redirect out of the dispatch cycle
window.setTimeout(() => this.transitionTo('pieces'), 0);
}
},

View File

@ -41,7 +41,8 @@ let PieceList = React.createClass({
componentDidUpdate() {
if (this.props.redirectTo && this.state.pieceListCount === 0) {
this.transitionTo(this.props.redirectTo);
// FIXME: hack to redirect out of the dispatch cycle
window.setTimeout(() => this.transitionTo(this.props.redirectTo), 0);
}
},