MOBILE-4088 timeline: Don't filter courses, can contain activities due

main
Pau Ferrer Ocaña 2022-03-22 11:15:23 +01:00
parent be28e1c2e4
commit 2dcb3895fa
1 changed files with 2 additions and 6 deletions

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CoreTimeUtils } from '@services/utils/time';
import { CoreSites } from '@services/sites'; import { CoreSites } from '@services/sites';
import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component';
import { AddonBlockTimeline } from '../../services/timeline'; import { AddonBlockTimeline } from '../../services/timeline';
@ -171,11 +170,8 @@ export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implemen
* @return Promise resolved when done. * @return Promise resolved when done.
*/ */
protected async fetchMyOverviewTimelineByCourses(): Promise<void> { protected async fetchMyOverviewTimelineByCourses(): Promise<void> {
const courses = await CoreCoursesHelper.getUserCoursesWithOptions(); // Do not filter courses by date because they can contain activities due.
const today = CoreTimeUtils.timestamp(); this.timelineCourses.courses = await CoreCoursesHelper.getUserCoursesWithOptions();
this.timelineCourses.courses = courses.filter((course) =>
(course.startdate || 0) <= today && (!course.enddate || course.enddate >= today));
if (this.timelineCourses.courses.length > 0) { if (this.timelineCourses.courses.length > 0) {
this.courseIds = this.timelineCourses.courses.map((course) => course.id); this.courseIds = this.timelineCourses.courses.map((course) => course.id);