Prevent registration race condition

This commit is contained in:
calzoneman 2013-11-05 22:39:51 -06:00
parent 33d1075d44
commit 22ba96b9fd
3 changed files with 23 additions and 0 deletions

View file

@ -161,6 +161,8 @@ $("#registerbtn").click(function() {
return;
}
$("#registerbtn").attr("disabled", true);
// Input valid, try registering
var data = {
name: name,
@ -168,6 +170,7 @@ $("#registerbtn").click(function() {
};
postJSON(WEB_URL + "/api/register?callback=?", data, function (data) {
$("#registerbtn").attr("disabled", false);
if(data.success) {
uname = name;
session = data.session;