From 65e60ed3ac9bfc529e94ed58730d852b1699574f Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 17 Mar 2021 12:14:27 +0100 Subject: [PATCH] MOBILE-3645 course: Fix loading not dismissed with course format plugin --- src/core/features/course/services/course.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/features/course/services/course.ts b/src/core/features/course/services/course.ts index 03e3192c2..de3db9eef 100644 --- a/src/core/features/course/services/course.ts +++ b/src/core/features/course/services/course.ts @@ -1038,7 +1038,7 @@ export class CoreCourseProvider { const loading = await CoreDomUtils.showModalLoading(); // Wait for site plugins to be fetched. - await CoreSitePlugins.waitFetchPlugins(); + await CoreUtils.ignoreErrors(CoreSitePlugins.waitFetchPlugins()); if (!('format' in course) || typeof course.format == 'undefined') { const result = await CoreCourseHelper.getCourse(course.id); @@ -1050,8 +1050,8 @@ export class CoreCourseProvider { if (!format || !CoreSitePlugins.sitePluginPromiseExists(`format_${format}`)) { // No custom format plugin. We don't need to wait for anything. - await CoreCourseFormatDelegate.openCourse( course, params); loading.dismiss(); + await CoreCourseFormatDelegate.openCourse( course, params); return; } @@ -1084,6 +1084,8 @@ export class CoreCourseProvider { await CoreDomUtils.showConfirm(message, '', reload, ignore); window.location.reload(); + } finally { + loading.dismiss(); } }