Merge pull request #3196 from crazyserver/MOBILE-4008

MOBILE-4088 timeline: Don't filter courses, can contain activities due
main
Noel De Martin 2022-03-22 12:08:35 +01:00 committed by GitHub
commit d446fc2f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);