From 8961086c8e7cfd5813fcafe5ce0cdf812ea1accb Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Wed, 21 Jun 2023 10:53:56 +0200 Subject: [PATCH] MOBILE-4377 sitehome: Show site home if has course blocks --- src/core/features/sitehome/services/sitehome.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/features/sitehome/services/sitehome.ts b/src/core/features/sitehome/services/sitehome.ts index ab145224e..f54cac477 100644 --- a/src/core/features/sitehome/services/sitehome.ts +++ b/src/core/features/sitehome/services/sitehome.ts @@ -21,6 +21,7 @@ import { CoreCourse } from '../../course/services/course'; import { CoreCourses } from '../../courses/services/courses'; import { AddonModForum, AddonModForumData } from '@addons/mod/forum/services/forum'; import { CoreError } from '@classes/errors/error'; +import { CoreBlockHelper } from '@features/block/services/block-helper'; /** * Items with index 1 and 3 were removed on 2.5 and not being supported in the app. @@ -98,8 +99,9 @@ export class CoreSiteHomeProvider { } const hasContent = sections.some((section) => section.summary || (section.modules && section.modules.length)); + const hasCourseBlocks = await CoreBlockHelper.hasCourseBlocks(siteHomeId); - if (hasContent) { + if (hasContent || hasCourseBlocks) { // There's a section with content. return true; }