Skip to content

Commit 01b3bc6

Browse files
committed
Use this.state.routeStack if present
1 parent 4675767 commit 01b3bc6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

App/Root.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ var Root = React.createClass({
4848
},
4949

5050
onUserChange: function() {
51-
this.setState(getUserState());
51+
var state = getUserState();
52+
// reset the route stack on user change.
53+
state.routeStack = null;
54+
this.setState(state);
5255
},
5356

5457
onEnvChange: function() {
@@ -86,7 +89,7 @@ var Root = React.createClass({
8689
renderContent: function() {
8790
if (this.state.routeUnderTest) return null;
8891

89-
var routeStack = Routes.parse(this.getSavedPath(), this.state.user.isLoggedIn(), true);
92+
var routeStack = this.state.routeStack || Routes.parse(this.getSavedPath(), this.state.user.isLoggedIn(), true);
9093

9194
if(this.state.user.isLoggedIn()) {
9295
return (

0 commit comments

Comments
 (0)