MOBILE-4270 core: Wait for platform ready before hiding splash

main
Dani Palou 2023-05-08 15:05:27 +02:00
parent fee132d6e8
commit cc565fe87b
1 changed files with 9 additions and 1 deletions

View File

@ -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();
});
}
/**