Merge pull request #2641 from dpalou/MOBILE-3616

MOBILE-3616 course: Fix loading not dismissed with course format plugin
main
Juan Leyva 2020-12-09 12:52:18 +01:00 committed by GitHub
commit bf4afaaccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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();
}
}