mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +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 user is already logged in, redirect him to piece list
|
||||||
if(this.state.currentUser && this.state.currentUser.email && this.props.redirectOnLoggedIn) {
|
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() {
|
componentDidUpdate() {
|
||||||
if (this.props.redirectTo && this.state.pieceListCount === 0) {
|
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…
x
Reference in New Issue
Block a user