Stop spinner and display XHR errors if they occur

Resolves GH-232
This commit is contained in:
Ray Schamp 2015-11-12 12:49:40 -05:00
parent c15b6a9681
commit 7ed45cb5dd

View file

@ -126,12 +126,14 @@ var Navigation = React.createClass({
json: formData, json: formData,
useCsrf: true useCsrf: true
}, function (err, body) { }, function (err, body) {
if (err) this.setState({'loginError': err.message});
if (body) { if (body) {
body = body[0]; body = body[0];
if (!body.success) { if (!body.success) {
if (body.redirect) { if (body.redirect) {
window.location = body.redirect; window.location = body.redirect;
} }
// Update login error message to a friendlier one if it exists
this.setState({'loginError': body.msg}); this.setState({'loginError': body.msg});
} else { } else {
this.closeLogin(); this.closeLogin();
@ -142,8 +144,9 @@ var Navigation = React.createClass({
}.bind(this)); }.bind(this));
window.refreshSession(); window.refreshSession();
} }
callback();
} }
// JS error already logged by api mixin
callback();
}.bind(this)); }.bind(this));
}, },
handleLogOut: function (e) { handleLogOut: function (e) {