From 61b4b6e8f7add6866173e061eb9021c829b0f7d3 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 1 Jun 2021 09:08:48 +0200 Subject: [PATCH] MOBILE-3320 course: Fix no error displayed when open module offline --- .../course/classes/main-activity-component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/features/course/classes/main-activity-component.ts b/src/core/features/course/classes/main-activity-component.ts index dedcd65d7..a601ad17a 100644 --- a/src/core/features/course/classes/main-activity-component.ts +++ b/src/core/features/course/classes/main-activity-component.ts @@ -127,10 +127,6 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR this.showCompletion ? CoreCourse.invalidateModule(this.module.id) : undefined, ])); - if (this.showCompletion) { - this.module = await CoreCourse.getModule(this.module.id, this.courseId); - } - await this.loadContent(true, sync, showErrors); } finally { this.refreshIcon = CoreConstants.ICON_REFRESH; @@ -205,6 +201,14 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR } try { + if (refresh && this.showCompletion) { + try { + this.module = await CoreCourse.getModule(this.module.id, this.courseId); + } catch { + // Ignore errors. + } + } + await this.fetchContent(refresh, sync, showErrors); } catch (error) { if (!refresh) {