Merge pull request #3719 from alfonso-salces/MOBILE-4377

MOBILE-4377 sitehome: Show site home if has course blocks
main
Noel De Martin 2023-06-21 11:05:47 +02:00 committed by GitHub
commit 3d5dcb22d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}