mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-28 04:13:18 +01:00
Make getBackground async
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user