Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit d4125f2

Browse files
feat: improve app first render (#1291)
1 parent b48f028 commit d4125f2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

studio/src/app/app-root.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Build, Component, Element, h, Listen, State} from '@stencil/core';
1+
import {Component, Element, h, Listen, State} from '@stencil/core';
22

33
import {toastController} from '@ionic/core';
44

@@ -48,19 +48,19 @@ export class AppRoot {
4848
this.langService = LangService.getInstance();
4949
}
5050

51-
async componentWillLoad() {
52-
if (Build.isBrowser) {
53-
const promises: Promise<void>[] = [
54-
this.authService.init(),
55-
this.offlineService.init(),
56-
this.themeService.initDarkModePreference(),
57-
this.colorService.init(),
58-
this.settingsService.init(),
59-
this.langService.init()
60-
];
61-
62-
await Promise.all(promises);
63-
}
51+
componentWillLoad() {
52+
const promises: Promise<void>[] = [
53+
this.authService.init(),
54+
this.offlineService.init(),
55+
this.themeService.initDarkModePreference(),
56+
this.colorService.init(),
57+
this.settingsService.init(),
58+
this.langService.init()
59+
];
60+
61+
Promise.all(promises).then(() => {
62+
// async componentWillLoad is render blocking and we want to display the app as soon as possible
63+
});
6464
}
6565

6666
async componentDidLoad() {

0 commit comments

Comments
 (0)