mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
Fix GH-25: close dropdowns on login/logout
This commit is contained in:
parent
6fba6c0a8f
commit
4e38c1a050
1 changed files with 8 additions and 0 deletions
|
@ -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});
|
||||
|
|
Loading…
Reference in a new issue