MOBILE-3320 course: Fix no error displayed when open module offline

main
Dani Palou 2021-06-01 09:08:48 +02:00
parent 7f9a0e9ae7
commit 61b4b6e8f7
1 changed files with 8 additions and 4 deletions

View File

@ -127,10 +127,6 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
this.showCompletion ? CoreCourse.invalidateModule(this.module.id) : undefined, 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); await this.loadContent(true, sync, showErrors);
} finally { } finally {
this.refreshIcon = CoreConstants.ICON_REFRESH; this.refreshIcon = CoreConstants.ICON_REFRESH;
@ -205,6 +201,14 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
} }
try { 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); await this.fetchContent(refresh, sync, showErrors);
} catch (error) { } catch (error) {
if (!refresh) { if (!refresh) {