MOBILE-3616 course: Fix loading not dismissed with course format plugin

main
Dani Palou 2020-12-03 15:21:26 +01:00
parent 4acedf95c1
commit 076c87813d
1 changed files with 5 additions and 2 deletions

View File

@ -982,7 +982,7 @@ export class CoreCourseProvider {
const loading = this.domUtils.showModalLoading(); const loading = this.domUtils.showModalLoading();
// Wait for site plugins to be fetched. // Wait for site plugins to be fetched.
await this.sitePluginsProvider.waitFetchPlugins(); await this.utils.ignoreErrors(this.sitePluginsProvider.waitFetchPlugins());
if (typeof course.format == 'undefined') { if (typeof course.format == 'undefined') {
// This block can be replaced by a call to CourseHelper.getCourse(), but it is circular dependant. // 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)) { if (!this.sitePluginsProvider.sitePluginPromiseExists('format_' + course.format)) {
// No custom format plugin. We don't need to wait for anything. // No custom format plugin. We don't need to wait for anything.
await this.courseFormatDelegate.openCourse(navCtrl, course, params);
loading.dismiss(); loading.dismiss();
await this.courseFormatDelegate.openCourse(navCtrl, course, params);
return; return;
} }
@ -1041,6 +1042,8 @@ export class CoreCourseProvider {
this.domUtils.showConfirm(message, '', reload, ignore).then(() => { this.domUtils.showConfirm(message, '', reload, ignore).then(() => {
window.location.reload(); window.location.reload();
}); });
} finally {
loading.dismiss();
} }
} }