Wait for contact sync before opening inbox

Use a canned bootstrap progress animation in lieu of better design.

Fix #271 // FREEBIE
This commit is contained in:
lilia 2015-08-06 12:30:51 -07:00
parent 4f1ce4c493
commit c3d3ec125d
4 changed files with 14 additions and 3 deletions

View file

@ -79,8 +79,17 @@
var accountManager = new bg.textsecure.AccountManager();
accountManager.registerSecondDevice(setProvisioningUrl, confirmNumber, incrementCounter).then(function() {
bg.openInbox();
window.close();
var launch = function() {
bg.openInbox();
bg.removeEventListener('textsecure:contactsync', launch);
clearTimeout(timeout);
window.close();
};
var timeout = setTimeout(launch, 60000);
bg.addEventListener('textsecure:contactsync', launch);
$('.progress-dialog .status').text('Syncing groups and contacts');
$('.progress-dialog .bar').addClass('progress-bar-striped active');
}).catch(function(e) {
if (e.name === 'HTTPError' && e.code == 411) {
$('.progress-dialog').hide();