Fix app init wait for backup on first link
Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
4fe00109bf
commit
c6e618a581
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 = new window.textsecure.AccountManager(server);
|
||||||
|
accountManager.addEventListener('startRegistration', () => {
|
||||||
|
backupReady.reject(new Error('startRegistration'));
|
||||||
|
backupReady = explodePromise();
|
||||||
|
});
|
||||||
accountManager.addEventListener('registration', () => {
|
accountManager.addEventListener('registration', () => {
|
||||||
window.Whisper.events.trigger('userChanged', false);
|
window.Whisper.events.trigger('userChanged', false);
|
||||||
|
|
||||||
|
|
|
@ -899,6 +899,7 @@ export default class AccountManager extends EventTarget {
|
||||||
private async createAccount(
|
private async createAccount(
|
||||||
options: CreateAccountOptionsType
|
options: CreateAccountOptionsType
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
this.dispatchEvent(new Event('startRegistration'));
|
||||||
const registrationBaton = this.server.startRegistration();
|
const registrationBaton = this.server.startRegistration();
|
||||||
try {
|
try {
|
||||||
await this.doCreateAccount(options);
|
await this.doCreateAccount(options);
|
||||||
|
|
Loading…
Add table
Reference in a new issue