Wait for appView
to be there in onEmpty
This commit is contained in:
parent
518f3ac017
commit
1746d27b5e
1 changed files with 11 additions and 0 deletions
|
@ -30,6 +30,11 @@ export async function startApp(): Promise<void> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let resolveOnAppView: (() => void) | undefined;
|
||||||
|
const onAppView = new Promise<void>(resolve => {
|
||||||
|
resolveOnAppView = resolve;
|
||||||
|
});
|
||||||
|
|
||||||
window.textsecure.protobuf.onLoad(() => {
|
window.textsecure.protobuf.onLoad(() => {
|
||||||
window.storage.onready(() => {
|
window.storage.onready(() => {
|
||||||
senderCertificateService.initialize({
|
senderCertificateService.initialize({
|
||||||
|
@ -1605,6 +1610,11 @@ export async function startApp(): Promise<void> {
|
||||||
await window.textsecure.messaging.sendRequestKeySyncMessage();
|
await window.textsecure.messaging.sendRequestKeySyncMessage();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (resolveOnAppView) {
|
||||||
|
resolveOnAppView();
|
||||||
|
resolveOnAppView = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.getSyncRequest = (timeoutMillis?: number) => {
|
window.getSyncRequest = (timeoutMillis?: number) => {
|
||||||
|
@ -2111,6 +2121,7 @@ export async function startApp(): Promise<void> {
|
||||||
window.Whisper.deliveryReceiptQueue.start();
|
window.Whisper.deliveryReceiptQueue.start();
|
||||||
window.Whisper.Notifications.enable();
|
window.Whisper.Notifications.enable();
|
||||||
|
|
||||||
|
await onAppView;
|
||||||
const view = window.owsDesktopApp.appView;
|
const view = window.owsDesktopApp.appView;
|
||||||
if (!view) {
|
if (!view) {
|
||||||
throw new Error('Expected `appView` to be initialized');
|
throw new Error('Expected `appView` to be initialized');
|
||||||
|
|
Loading…
Reference in a new issue