Merge pull request #1689 from crazyserver/MOBILE-2688-2

MOBILE-2688 course: Show message error when starring in offline
main
Juan Leyva 2018-12-21 12:46:39 +01:00 committed by GitHub
commit abddc4766d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -219,6 +219,10 @@ export class CoreCoursesCourseProgressComponent implements OnInit, OnDestroy {
this.course.hidden = hide;
this.eventsProvider.trigger(
CoreCoursesProvider.EVENT_MY_COURSES_UPDATED, {course: this.course}, this.sitesProvider.getCurrentSiteId());
}).catch((error) => {
if (!this.isDestroyed) {
this.domUtils.showErrorModalDefault(error, 'Error changing course visibility.');
}
}).finally(() => {
this.showSpinner = false;
});
@ -236,6 +240,10 @@ export class CoreCoursesCourseProgressComponent implements OnInit, OnDestroy {
this.course.isfavourite = favourite;
this.eventsProvider.trigger(
CoreCoursesProvider.EVENT_MY_COURSES_UPDATED, {course: this.course}, this.sitesProvider.getCurrentSiteId());
}).catch((error) => {
if (!this.isDestroyed) {
this.domUtils.showErrorModalDefault(error, 'Error changing course favourite attribute.');
}
}).finally(() => {
this.showSpinner = false;
});