From 973af81fcc0719e7cef96b1d482411de24eee84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 21 Dec 2018 12:10:42 +0100 Subject: [PATCH] MOBILE-2688 course: Show message error when starring in offline --- .../courses/components/course-progress/course-progress.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/courses/components/course-progress/course-progress.ts b/src/core/courses/components/course-progress/course-progress.ts index adba3fdba..7f9e40487 100644 --- a/src/core/courses/components/course-progress/course-progress.ts +++ b/src/core/courses/components/course-progress/course-progress.ts @@ -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; });