mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Stop spinner and display XHR errors if they occur
Resolves GH-232
This commit is contained in:
parent
c15b6a9681
commit
7ed45cb5dd
1 changed files with 4 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue