show form and switch buttons if error

pull/1/head
David Benqué 5 years ago
parent 5302077be1
commit d2ea3c4221

@ -1719,7 +1719,7 @@ define([
$(linkForm).hide(); $(linkForm).hide();
$(linkSpin).show(); $(linkSpin).show();
$nav.find('button.cp-teams-invite-create').hide(); $nav.find('button.cp-teams-invite-create').hide();
$nav.find('button.cp-teams-invite-copy').show() $nav.find('button.cp-teams-invite-copy').show();
setTimeout(waitFor(), 150); setTimeout(waitFor(), 150);
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
InviteInner.deriveBytes(seeds.scrypt, salt, waitFor(function (_bytes) { InviteInner.deriveBytes(seeds.scrypt, salt, waitFor(function (_bytes) {
@ -1739,6 +1739,9 @@ define([
if (obj && obj.error) { if (obj && obj.error) {
waitFor.abort(); waitFor.abort();
$(linkSpin).hide(); $(linkSpin).hide();
$(linkForm).show(); // XXX DB: check this is the right place to put things back
$nav.find('button.cp-teams-invite-create').show();
$nav.find('button.cp-teams-invite-copy').hide();
return void $(linkError).text(Messages.team_inviteLinkError+obj.error).show(); // XXX return void $(linkError).text(Messages.team_inviteLinkError+obj.error).show(); // XXX
} }
// Display result here // Display result here

Loading…
Cancel
Save