From d96294e85b4ca40039fda42cd1c670115f7615de Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 7 Oct 2015 15:01:34 -0400 Subject: [PATCH] Close login dropdown and clear errors on login --- src/components/navigation/navigation.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/navigation/navigation.jsx b/src/components/navigation/navigation.jsx index 674ce72f9..277c66c75 100644 --- a/src/components/navigation/navigation.jsx +++ b/src/components/navigation/navigation.jsx @@ -34,6 +34,7 @@ module.exports = React.createClass({ this.setState({'loginOpen': false}); }, handleLogIn: function (formData) { + this.setState({'loginError': null}); this.api({ method: 'post', uri: '/accounts/login/', @@ -44,8 +45,10 @@ module.exports = React.createClass({ body = body[0]; if (!body.success) { this.setState({'loginError': body.msg}); + } else { + this.closeLogin(); + window.refreshSession(); } - window.refreshSession(); } }.bind(this)); }, @@ -56,9 +59,10 @@ module.exports = React.createClass({ if (err) { log.error(err); } else { + this.closeLogin(); window.refreshSession(); } - }); + }.bind(this)); }, handleClickAccountNav: function () { this.setState({'accountNavOpen': true});