diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js index 2f4f95b7..ddfbfc10 100644 --- a/js/components/ascribe_forms/form_login.js +++ b/js/components/ascribe_forms/form_login.js @@ -57,7 +57,7 @@ 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) { // FIXME: hack to redirect out of the dispatch cycle - window.setTimeout(() => this.history.pushState(null, '/pieces');, 0); + window.setTimeout(() => this.history.pushState(null, '/pieces'), 0); } }, diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 579242c3..62bc61d8 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -76,7 +76,7 @@ let PieceList = React.createClass({ componentDidUpdate() { if (this.props.redirectTo && this.state.unfilteredPieceListCount === 0) { // FIXME: hack to redirect out of the dispatch cycle - window.setTimeout(() => this.history.pushState(null, this.props.redirectTo, this.props.location.query); + window.setTimeout(() => this.history.pushState(null, this.props.redirectTo, this.props.location.query), 0); } },