after successful registration user should be logged in
This commit is contained in:
@@ -10,8 +10,8 @@ var LoginStatus = React.createClass({
|
||||
return UserStore.getLoginState();
|
||||
},
|
||||
componentDidMount: function() {
|
||||
UserActions.checkLogin();
|
||||
UserStore.addChangeListener(this.onUserStateChange);
|
||||
UserActions.checkLogin();
|
||||
},
|
||||
componentWillReceiveProps: function() {
|
||||
this.update();
|
||||
@@ -23,7 +23,9 @@ var LoginStatus = React.createClass({
|
||||
this.update();
|
||||
},
|
||||
update: function() {
|
||||
this.setState(UserStore.getLoginState());
|
||||
if(this.isMounted()) {
|
||||
this.setState(UserStore.getLoginState());
|
||||
}
|
||||
},
|
||||
logout: function(e){
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user