Make getBackground async
This commit is contained in:
parent
a57363f1c0
commit
76e170686a
6 changed files with 198 additions and 175 deletions
|
@ -69,22 +69,23 @@
|
|||
});
|
||||
|
||||
$(function() {
|
||||
var bg = extension.windows.getBackground();
|
||||
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...");
|
||||
|
||||
var accountManager = new bg.textsecure.AccountManager();
|
||||
accountManager.registerSecondDevice(setProvisioningUrl, confirmNumber, incrementCounter).then(function() {
|
||||
$('.modal-container').hide();
|
||||
$('#init-setup').hide();
|
||||
extension.windows.getBackground(function(bg) {
|
||||
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...");
|
||||
|
||||
var accountManager = new bg.textsecure.AccountManager();
|
||||
accountManager.registerSecondDevice(setProvisioningUrl, confirmNumber, incrementCounter).then(function() {
|
||||
$('.modal-container').hide();
|
||||
$('#init-setup').hide();
|
||||
$('#setup-complete').show().addClass('in');
|
||||
initOptions();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue