MOBILE-4138 home: Check all handlers in MainMenuHomeHandler

main
Pau Ferrer Ocaña 2024-11-19 12:47:31 +01:00
parent bfe8f4c24f
commit 94260567cc
1 changed files with 3 additions and 8 deletions

View File

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