forked from EVOgeek/Vmeda.Online
		
	MOBILE-3320 home: Try to prevent empty box displayed for an instant
This commit is contained in:
		
							parent
							
								
									da050a66c8
								
							
						
					
					
						commit
						c2e82f7ad1
					
				| @ -12,9 +12,7 @@ | ||||
|     </ion-toolbar> | ||||
| </ion-header> | ||||
| <core-loading [hideUntil]="loaded"> | ||||
|     <ng-container *ngIf="tabs.length == 0"> | ||||
|         <core-empty-box icon="fas-home" [message]="'core.courses.nocourses' | translate"></core-empty-box> | ||||
|     </ng-container> | ||||
|     <core-empty-box *ngIf="tabs.length == 0" icon="fas-home" [message]="'core.courses.nocourses' | translate"></core-empty-box> | ||||
| </core-loading> | ||||
| <core-tabs-outlet *ngIf="tabs.length > 0" [selectedIndex]="selectedTab" [hideUntil]="loaded" [tabs]="tabs" | ||||
|     (ionChange)="tabSelected()"> | ||||
|  | ||||
| @ -86,6 +86,7 @@ export class CoreMainMenuHomePage implements OnInit { | ||||
|      */ | ||||
|     initHandlers(handlers: CoreMainMenuHomeHandlerToDisplay[]): void { | ||||
|         // Re-build the list of tabs.
 | ||||
|         const loaded = CoreMainMenuHomeDelegate.areHandlersLoaded(); | ||||
|         const handlersMap = CoreUtils.arrayToObject(handlers, 'title'); | ||||
|         const newTabs = handlers.map((handler): CoreTabsOutletTab => { | ||||
|             const tab = this.tabs.find(tab => tab.title == handler.title); | ||||
| @ -125,7 +126,10 @@ export class CoreMainMenuHomePage implements OnInit { | ||||
| 
 | ||||
|         this.tabs = newTabs; | ||||
| 
 | ||||
|         this.loaded = CoreMainMenuHomeDelegate.areHandlersLoaded(); | ||||
|         // Try to prevent empty box displayed for an instant when it shouldn't.
 | ||||
|         setTimeout(() => { | ||||
|             this.loaded = loaded; | ||||
|         }, 50); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user