|
1 | | -import {Build, Component, Element, h, Listen, State} from '@stencil/core'; |
| 1 | +import {Component, Element, h, Listen, State} from '@stencil/core'; |
2 | 2 |
|
3 | 3 | import {toastController} from '@ionic/core'; |
4 | 4 |
|
@@ -48,19 +48,19 @@ export class AppRoot { |
48 | 48 | this.langService = LangService.getInstance(); |
49 | 49 | } |
50 | 50 |
|
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 | + }); |
64 | 64 | } |
65 | 65 |
|
66 | 66 | async componentDidLoad() { |
|
0 commit comments