MOBILE-2721 Keep existing displayname if not set

core_enrol_get_users_courses does not return displayname before MDL-63523,
which causes the page title to revert to fullname after the course
has fully loaded.
main
Mark Johnson 2018-12-20 09:38:15 +00:00
parent 138221e136
commit a6fb4a51bc
1 changed files with 4 additions and 0 deletions

View File

@ -171,6 +171,10 @@ export class CoreCourseSectionPage implements OnDestroy {
// Error getting the course, probably guest access.
}).then((course) => {
if (course) {
if (this.course.id === course.id && this.course.hasOwnProperty('displayname')
&& !course.hasOwnProperty('displayname')) {
course.displayname = this.course.displayname;
}
this.course = course;
}