Work on auth error handling / reinstall

This commit is contained in:
lilia 2015-06-19 15:32:25 -07:00
parent ef8a977f38
commit f126e3b21b
5 changed files with 62 additions and 13 deletions

View file

@ -74,20 +74,21 @@
});
$(function() {
if (bg.textsecure.registration.isDone()) {
$('#complete-number').text(bg.textsecure.storage.user.getNumber());
$('#setup-complete').show().addClass('in');
initOptions();
} else {
$('#init-setup').show().addClass('in');
$('#status').text("Connecting...");
$('#init-setup').show().addClass('in');
$('#status').text("Connecting...");
var accountManager = new bg.textsecure.AccountManager();
accountManager.registerSecondDevice(setProvisioningUrl, confirmNumber, incrementCounter).then(function() {
bg.openInbox();
window.close();
});
}
var accountManager = new bg.textsecure.AccountManager();
accountManager.registerSecondDevice(setProvisioningUrl, confirmNumber, incrementCounter).then(function() {
bg.openInbox();
window.close();
}).catch(function(e) {
if (e.name === 'HTTPError' && e.message == 411) {
return; // TODO: too many devices
}
else {
throw e;
}
});
});
});
})();