Fix app init wait for backup on first link
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
f8041ee1a4
commit
5e767d45a2
2 changed files with 5 additions and 0 deletions
|
@ -400,6 +400,10 @@ export async function startApp(): Promise<void> {
|
|||
}
|
||||
|
||||
accountManager = new window.textsecure.AccountManager(server);
|
||||
accountManager.addEventListener('startRegistration', () => {
|
||||
backupReady.reject(new Error('startRegistration'));
|
||||
backupReady = explodePromise();
|
||||
});
|
||||
accountManager.addEventListener('registration', () => {
|
||||
window.Whisper.events.trigger('userChanged', false);
|
||||
|
||||
|
|
|
@ -899,6 +899,7 @@ export default class AccountManager extends EventTarget {
|
|||
private async createAccount(
|
||||
options: CreateAccountOptionsType
|
||||
): Promise<void> {
|
||||
this.dispatchEvent(new Event('startRegistration'));
|
||||
const registrationBaton = this.server.startRegistration();
|
||||
try {
|
||||
await this.doCreateAccount(options);
|
||||
|
|
Loading…
Reference in a new issue