From 7ed45cb5dd86db28bfbe29b53f9e3574640cae8c Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Thu, 12 Nov 2015 12:49:40 -0500 Subject: [PATCH] Stop spinner and display XHR errors if they occur Resolves GH-232 --- src/components/navigation/navigation.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/navigation/navigation.jsx b/src/components/navigation/navigation.jsx index face8803e..ad8bb4eef 100644 --- a/src/components/navigation/navigation.jsx +++ b/src/components/navigation/navigation.jsx @@ -126,12 +126,14 @@ var Navigation = React.createClass({ json: formData, useCsrf: true }, function (err, body) { + if (err) this.setState({'loginError': err.message}); if (body) { body = body[0]; if (!body.success) { if (body.redirect) { window.location = body.redirect; } + // Update login error message to a friendlier one if it exists this.setState({'loginError': body.msg}); } else { this.closeLogin(); @@ -142,8 +144,9 @@ var Navigation = React.createClass({ }.bind(this)); window.refreshSession(); } - callback(); } + // JS error already logged by api mixin + callback(); }.bind(this)); }, handleLogOut: function (e) {