From 94260567cc8f71340ec7510528c8ed9ee70a19d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 19 Nov 2024 12:47:31 +0100 Subject: [PATCH] MOBILE-4138 home: Check all handlers in MainMenuHomeHandler --- .../features/mainmenu/services/handlers/mainmenu.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/core/features/mainmenu/services/handlers/mainmenu.ts b/src/core/features/mainmenu/services/handlers/mainmenu.ts index 689ff62fc..44e9b186b 100644 --- a/src/core/features/mainmenu/services/handlers/mainmenu.ts +++ b/src/core/features/mainmenu/services/handlers/mainmenu.ts @@ -13,10 +13,8 @@ // limitations under the License. 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 { CoreMainMenuHomeDelegate } from '../home-delegate'; import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../mainmenu-delegate'; /** @@ -34,12 +32,9 @@ export class CoreMainMenuHomeHandlerService implements CoreMainMenuHandler { * @inheritdoc */ async isEnabled(): Promise { - const siteId = CoreSites.getCurrentSiteId(); + await CoreMainMenuHomeDelegate.waitForReady(); - const dashboardEnabled = await CoreDashboardHomeHandler.isEnabledForSite(siteId); - const siteHomeEnabled = await CoreSiteHomeHomeHandler.isEnabledForSite(siteId); - - return dashboardEnabled || siteHomeEnabled; + return CoreMainMenuHomeDelegate.hasHandlers(true); } /**