diff --git a/src/addons/block/timeline/components/timeline/addon-block-timeline.html b/src/addons/block/timeline/components/timeline/addon-block-timeline.html index 81c32360d..a955b9b69 100644 --- a/src/addons/block/timeline/components/timeline/addon-block-timeline.html +++ b/src/addons/block/timeline/components/timeline/addon-block-timeline.html @@ -47,6 +47,6 @@ [course]="course" [from]="dataFrom" [to]="dataTo"> + [message]="'addon.block_timeline.noevents' | translate"> diff --git a/src/addons/block/timeline/components/timeline/timeline.ts b/src/addons/block/timeline/components/timeline/timeline.ts index c8ef64b77..2eb6979df 100644 --- a/src/addons/block/timeline/components/timeline/timeline.ts +++ b/src/addons/block/timeline/components/timeline/timeline.ts @@ -176,9 +176,15 @@ export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implemen const courseEvents = await AddonBlockTimeline.getActionEventsByCourses(this.courseIds); - this.timelineCourses.courses.forEach((course) => { + this.timelineCourses.courses = this.timelineCourses.courses.filter((course) => { + if (courseEvents[course.id].events.length == 0) { + return false; + } + course.events = courseEvents[course.id].events; course.canLoadMore = courseEvents[course.id].canLoadMore; + + return true; }); } }