From 076c87813d634a76fba845cdda6168cc3fe27764 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 3 Dec 2020 15:21:26 +0100 Subject: [PATCH] MOBILE-3616 course: Fix loading not dismissed with course format plugin --- src/core/course/providers/course.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/course/providers/course.ts b/src/core/course/providers/course.ts index 7e6d02696..74289d6f4 100644 --- a/src/core/course/providers/course.ts +++ b/src/core/course/providers/course.ts @@ -982,7 +982,7 @@ export class CoreCourseProvider { const loading = this.domUtils.showModalLoading(); // Wait for site plugins to be fetched. - await this.sitePluginsProvider.waitFetchPlugins(); + await this.utils.ignoreErrors(this.sitePluginsProvider.waitFetchPlugins()); if (typeof course.format == 'undefined') { // This block can be replaced by a call to CourseHelper.getCourse(), but it is circular dependant. @@ -1006,9 +1006,10 @@ export class CoreCourseProvider { if (!this.sitePluginsProvider.sitePluginPromiseExists('format_' + course.format)) { // No custom format plugin. We don't need to wait for anything. - await this.courseFormatDelegate.openCourse(navCtrl, course, params); loading.dismiss(); + await this.courseFormatDelegate.openCourse(navCtrl, course, params); + return; } @@ -1041,6 +1042,8 @@ export class CoreCourseProvider { this.domUtils.showConfirm(message, '', reload, ignore).then(() => { window.location.reload(); }); + } finally { + loading.dismiss(); } }