MOBILE-4377 sitehome: Show site home if has course blocks

main
Alfonso Salces 2023-06-21 10:53:56 +02:00
parent 24c1b38da5
commit 8961086c8e
1 changed files with 3 additions and 1 deletions

View File

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