Merge pull request #1695 from dpalou/MOBILE-2801

MOBILE-2801 course: Fix update displayname in overview
main
Juan Leyva 2018-12-21 21:35:04 +01:00 committed by GitHub
commit 1767c2833e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -150,6 +150,10 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
*/
protected fetchContent(): Promise<any> {
return this.coursesHelper.getUserCoursesWithOptions(this.sort).then((courses) => {
this.courseIds = courses.map((course) => {
return course.id;
});
this.showSortFilter = courses.length > 0 && typeof courses[0].lastaccess != 'undefined';
this.initCourseFilters(courses);

View File

@ -118,6 +118,11 @@ export class CoreCoursesProvider {
// Always add the site home ID.
courseIds.push(siteHomeId);
// Sort the course IDs.
courseIds.sort((a, b) => {
return b - a;
});
}
return courseIds;
@ -130,6 +135,11 @@ export class CoreCoursesProvider {
courseIds.push(siteHomeId);
}
// Sort the course IDs.
courseIds.sort((a, b) => {
return b - a;
});
return courseIds;
}
});