From cc565fe87b9ef52df5a299c3081ddfd04107743d Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 8 May 2023 15:05:27 +0200 Subject: [PATCH] MOBILE-4270 core: Wait for platform ready before hiding splash --- src/app/app.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c86dd90f9..2462f1841 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,6 +33,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreDom } from '@singletons/dom'; import { CorePlatform } from '@services/platform'; import { CoreUrl } from '@singletons/url'; +import { CoreLogger } from '@singletons/logger'; const MOODLE_SITE_URL_PREFIX = 'url-'; const MOODLE_VERSION_PREFIX = 'version-'; @@ -46,6 +47,8 @@ export class AppComponent implements OnInit, AfterViewInit { @ViewChild(IonRouterOutlet) outlet?: IonRouterOutlet; + protected logger = CoreLogger.getInstance('AppComponent'); + /** * @inheritdoc */ @@ -196,7 +199,12 @@ export class AppComponent implements OnInit, AfterViewInit { return; } - CoreSubscriptions.once(this.outlet.activateEvents, () => SplashScreen.hide()); + CoreSubscriptions.once(this.outlet.activateEvents, async () => { + await CorePlatform.ready(); + + this.logger.debug('Hide splash screen'); + SplashScreen.hide(); + }); } /**