Merge pull request #3663 from dpalou/MOBILE-4270
MOBILE-4270 core: Wait for platform ready before hiding splash
This commit is contained in:
		
						commit
						78cda0eecd
					
				| @ -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(); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user