diff --git a/www/common/rpc.js b/www/common/rpc.js index 530a65483..02453a9e8 100644 --- a/www/common/rpc.js +++ b/www/common/rpc.js @@ -63,6 +63,7 @@ types of messages: // RPC responses are arrays. this message isn't meant for us. return; } + if (/FULL_HISTORY/.test(parsed[0])) { return; } var response = parsed.slice(2); @@ -98,7 +99,7 @@ types of messages: delete ctx.pending[txid]; return; } - console.error("received message for txid[%s] with no callback", txid); + console.error("received message [%s] for txid[%s] with no callback", msg, txid); }; var create = function (network, edPrivateKey, edPublicKey, cb) { diff --git a/www/register/main.js b/www/register/main.js index bdaca5197..f0b9a2e9c 100644 --- a/www/register/main.js +++ b/www/register/main.js @@ -63,6 +63,7 @@ define([ var $register = $('button#register'); + var registering = false; var logMeIn = function (result) { if (Test.testing) { Test.passed(); @@ -79,6 +80,7 @@ define([ Cryptpad.whenRealtimeSyncs(result.realtime, function () { Cryptpad.login(result.userHash, result.userName, function () { + registering = false; if (sessionStorage.redirectTo) { var h = sessionStorage.redirectTo; var parser = document.createElement('a'); @@ -95,6 +97,11 @@ define([ }; $register.click(function () { + if (registering) { + console.log("registration is already in progress"); + return; + } + var uname = $uname.val(); var passwd = $passwd.val(); var confirmPassword = $confirm.val(); @@ -115,6 +122,7 @@ define([ function (yes) { if (!yes) { return; } + registering = true; // setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up window.setTimeout(function () { Cryptpad.addLoadingScreen(Messages.login_hashing); @@ -127,20 +135,27 @@ define([ switch (err) { case 'NO_SUCH_USER': Cryptpad.removeLoadingScreen(function () { - Cryptpad.alert(Messages.login_noSuchUser); + Cryptpad.alert(Messages.login_noSuchUser, function () { + registering = false; + }); }); break; case 'INVAL_USER': Cryptpad.removeLoadingScreen(function () { - Cryptpad.alert(Messages.login_invalUser); + Cryptpad.alert(Messages.login_invalUser, function () { + registering = false; + }); }); break; case 'INVAL_PASS': Cryptpad.removeLoadingScreen(function () { - Cryptpad.alert(Messages.login_invalPass); + Cryptpad.alert(Messages.login_invalPass, function () { + registering = false; + }); }); break; case 'ALREADY_REGISTERED': + // logMeIn should reset registering = false Cryptpad.removeLoadingScreen(function () { Cryptpad.confirm(Messages.register_alreadyRegistered, function (yes) { if (!yes) { return; } @@ -155,6 +170,7 @@ define([ }); break; default: // UNHANDLED ERROR + registering = false; Cryptpad.errorLoadingScreen(Messages.login_unhandledError); } return; diff --git a/www/slide/slide.js b/www/slide/slide.js index fd5277853..f0e47a272 100644 --- a/www/slide/slide.js +++ b/www/slide/slide.js @@ -144,7 +144,7 @@ define([ updateFontSize(); }; - Slide.update = function (content, init) { + Slide.update = function (content) { updateFontSize(); //if (!init) { return; } if (!content) { content = ''; }