Fix GH-25: close dropdowns on login/logout

This commit is contained in:
Ray Schamp 2015-10-07 20:21:10 -04:00
parent 6fba6c0a8f
commit 4e38c1a050

View file

@ -26,6 +26,14 @@ module.exports = React.createClass({
'accountNavOpen': false
};
},
componentDidUpdate: function (prevProps, prevState) {
if (prevState.session.user != this.state.session.user) {
this.setState({
'loginOpen': false,
'accountNavOpen': false
});
}
},
handleLoginClick: function (e) {
e.preventDefault();
this.setState({'loginOpen': true});