diff --git a/src/addons/blog/services/handlers/mainmenu.ts b/src/addons/blog/services/handlers/mainmenu.ts index 6b49a07ec..142a3d679 100644 --- a/src/addons/blog/services/handlers/mainmenu.ts +++ b/src/addons/blog/services/handlers/mainmenu.ts @@ -26,7 +26,7 @@ export class AddonBlogMainMenuHandlerService implements CoreMainMenuHandler { static readonly PAGE_NAME = 'blog'; name = 'AddonBlog'; - priority = 450; + priority = 500; /** * @inheritdoc diff --git a/src/addons/calendar/services/handlers/mainmenu.ts b/src/addons/calendar/services/handlers/mainmenu.ts index 2893888a5..209dc0bb1 100644 --- a/src/addons/calendar/services/handlers/mainmenu.ts +++ b/src/addons/calendar/services/handlers/mainmenu.ts @@ -26,7 +26,7 @@ export class AddonCalendarMainMenuHandlerService implements CoreMainMenuHandler static readonly PAGE_NAME = 'calendar'; name = 'AddonCalendar'; - priority = 900; + priority = 800; /** * Check if the handler is enabled on a site level. diff --git a/src/addons/messages/services/handlers/mainmenu.ts b/src/addons/messages/services/handlers/mainmenu.ts index 564f844ba..ea20c90d6 100644 --- a/src/addons/messages/services/handlers/mainmenu.ts +++ b/src/addons/messages/services/handlers/mainmenu.ts @@ -38,7 +38,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, static readonly PAGE_NAME = 'messages'; name = 'AddonMessages'; - priority = 800; + priority = 700; protected handler: CoreMainMenuHandlerToDisplay = { icon: 'fas-comments', diff --git a/src/addons/notifications/services/handlers/mainmenu.ts b/src/addons/notifications/services/handlers/mainmenu.ts index bd4800729..de21bc147 100644 --- a/src/addons/notifications/services/handlers/mainmenu.ts +++ b/src/addons/notifications/services/handlers/mainmenu.ts @@ -33,7 +33,7 @@ export class AddonNotificationsMainMenuHandlerService implements CoreMainMenuHan static readonly PAGE_NAME = 'notifications'; name = 'AddonNotifications'; - priority = 700; + priority = 600; protected handlerData: CoreMainMenuHandlerData = { icon: 'fas-bell', diff --git a/src/core/features/courses/services/handlers/my-courses-mainmenu.ts b/src/core/features/courses/services/handlers/my-courses-mainmenu.ts index 3c3991a5c..8c2c51878 100644 --- a/src/core/features/courses/services/handlers/my-courses-mainmenu.ts +++ b/src/core/features/courses/services/handlers/my-courses-mainmenu.ts @@ -29,7 +29,7 @@ export class CoreCoursesMyCoursesMainMenuHandlerService implements CoreMainMenuH static readonly PAGE_NAME = 'courses'; name = 'CoreCoursesMyCourses'; - priority = 850; + priority = 900; /** * @inheritdoc diff --git a/src/core/features/mainmenu/services/handlers/mainmenu.ts b/src/core/features/mainmenu/services/handlers/mainmenu.ts index 45c6bd8ba..a582228ba 100644 --- a/src/core/features/mainmenu/services/handlers/mainmenu.ts +++ b/src/core/features/mainmenu/services/handlers/mainmenu.ts @@ -13,6 +13,9 @@ // 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 { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../mainmenu-delegate'; @@ -25,13 +28,18 @@ export class CoreMainMenuHomeHandlerService implements CoreMainMenuHandler { static readonly PAGE_NAME = 'home'; name = 'CoreHome'; - priority = 1100; + priority = 1000; /** * @inheritdoc */ async isEnabled(): Promise { - return true; + const siteId = CoreSites.getCurrentSiteId(); + + const dashboardEnabled = await CoreDashboardHomeHandler.isEnabledForSite(siteId); + const siteHomeEnabled = await CoreSiteHomeHomeHandler.isEnabledForSite(siteId); + + return dashboardEnabled || siteHomeEnabled; } /** diff --git a/src/core/features/tag/services/handlers/mainmenu.ts b/src/core/features/tag/services/handlers/mainmenu.ts index 6a434dccf..1a1a7cf77 100644 --- a/src/core/features/tag/services/handlers/mainmenu.ts +++ b/src/core/features/tag/services/handlers/mainmenu.ts @@ -27,7 +27,7 @@ export class CoreTagMainMenuHandlerService implements CoreMainMenuHandler { static readonly PAGE_NAME = 'tag'; name = 'CoreTag'; - priority = 300; + priority = 400; /** * Check if the handler is enabled on a site level.