瀏覽代碼

Ensures preload will be removed

main
Eric Amodio 2 年之前
父節點
當前提交
8d5d458c96
共有 1 個文件被更改,包括 13 次插入11 次删除
  1. +13
    -11
      src/webviews/apps/shared/appBase.ts

+ 13
- 11
src/webviews/apps/shared/appBase.ts 查看文件

@ -46,20 +46,22 @@ export abstract class App {
requestAnimationFrame(() => {
this.log(`${this.appName}.initializing`);
this.onInitialize?.();
this.bind();
try {
this.onInitialize?.();
this.bind();
if (this.onMessageReceived != null) {
window.addEventListener('message', this.onMessageReceived.bind(this));
}
this.sendCommand(WebviewReadyCommandType, undefined);
if (this.onMessageReceived != null) {
window.addEventListener('message', this.onMessageReceived.bind(this));
}
this.onInitialized?.();
this.sendCommand(WebviewReadyCommandType, undefined);
setTimeout(() => {
document.body.classList.remove('preload');
}, 500);
this.onInitialized?.();
} finally {
setTimeout(() => {
document.body.classList.remove('preload');
}, 500);
}
});
}

Loading…
取消
儲存