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:
parent
aec1ff2173
commit
d093fe013c
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user