Merge pull request #1695 from dpalou/MOBILE-2801
MOBILE-2801 course: Fix update displayname in overview
This commit is contained in:
		
						commit
						1767c2833e
					
				@ -150,6 +150,10 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    protected fetchContent(): Promise<any> {
 | 
					    protected fetchContent(): Promise<any> {
 | 
				
			||||||
        return this.coursesHelper.getUserCoursesWithOptions(this.sort).then((courses) => {
 | 
					        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.showSortFilter = courses.length > 0 && typeof courses[0].lastaccess != 'undefined';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.initCourseFilters(courses);
 | 
					            this.initCourseFilters(courses);
 | 
				
			||||||
 | 
				
			|||||||
@ -118,6 +118,11 @@ export class CoreCoursesProvider {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                        // Always add the site home ID.
 | 
					                        // Always add the site home ID.
 | 
				
			||||||
                        courseIds.push(siteHomeId);
 | 
					                        courseIds.push(siteHomeId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // Sort the course IDs.
 | 
				
			||||||
 | 
					                        courseIds.sort((a, b) => {
 | 
				
			||||||
 | 
					                           return b - a;
 | 
				
			||||||
 | 
					                        });
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    return courseIds;
 | 
					                    return courseIds;
 | 
				
			||||||
@ -130,6 +135,11 @@ export class CoreCoursesProvider {
 | 
				
			|||||||
                    courseIds.push(siteHomeId);
 | 
					                    courseIds.push(siteHomeId);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                // Sort the course IDs.
 | 
				
			||||||
 | 
					                courseIds.sort((a, b) => {
 | 
				
			||||||
 | 
					                   return b - a;
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return courseIds;
 | 
					                return courseIds;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user