forked from CIT/Vmeda.Online
		
	MOBILE-4138 home: Check all handlers in MainMenuHomeHandler
This commit is contained in:
		
							parent
							
								
									bfe8f4c24f
								
							
						
					
					
						commit
						94260567cc
					
				@ -13,10 +13,8 @@
 | 
				
			|||||||
// limitations under the License.
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { Injectable } from '@angular/core';
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
import { CoreDashboardHomeHandler } from '@features/courses/services/handlers/dashboard-home';
 | 
					 | 
				
			||||||
import { CoreSiteHomeHomeHandler } from '@features/sitehome/services/handlers/sitehome-home';
 | 
					 | 
				
			||||||
import { CoreSites } from '@services/sites';
 | 
					 | 
				
			||||||
import { makeSingleton } from '@singletons';
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					import { CoreMainMenuHomeDelegate } from '../home-delegate';
 | 
				
			||||||
import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../mainmenu-delegate';
 | 
					import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../mainmenu-delegate';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -34,12 +32,9 @@ export class CoreMainMenuHomeHandlerService implements CoreMainMenuHandler {
 | 
				
			|||||||
     * @inheritdoc
 | 
					     * @inheritdoc
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    async isEnabled(): Promise<boolean> {
 | 
					    async isEnabled(): Promise<boolean> {
 | 
				
			||||||
        const siteId = CoreSites.getCurrentSiteId();
 | 
					        await CoreMainMenuHomeDelegate.waitForReady();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const dashboardEnabled = await CoreDashboardHomeHandler.isEnabledForSite(siteId);
 | 
					        return CoreMainMenuHomeDelegate.hasHandlers(true);
 | 
				
			||||||
        const siteHomeEnabled = await CoreSiteHomeHomeHandler.isEnabledForSite(siteId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return dashboardEnabled || siteHomeEnabled;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user