Skip to content

Commit bf4afaa

Browse files
authored
Merge pull request #2641 from dpalou/MOBILE-3616
MOBILE-3616 course: Fix loading not dismissed with course format plugin
2 parents 4acedf9 + 076c878 commit bf4afaa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/course/providers/course.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ export class CoreCourseProvider {
982982
const loading = this.domUtils.showModalLoading();
983983

984984
// Wait for site plugins to be fetched.
985-
await this.sitePluginsProvider.waitFetchPlugins();
985+
await this.utils.ignoreErrors(this.sitePluginsProvider.waitFetchPlugins());
986986

987987
if (typeof course.format == 'undefined') {
988988
// This block can be replaced by a call to CourseHelper.getCourse(), but it is circular dependant.
@@ -1006,9 +1006,10 @@ export class CoreCourseProvider {
10061006

10071007
if (!this.sitePluginsProvider.sitePluginPromiseExists('format_' + course.format)) {
10081008
// No custom format plugin. We don't need to wait for anything.
1009-
await this.courseFormatDelegate.openCourse(navCtrl, course, params);
10101009
loading.dismiss();
10111010

1011+
await this.courseFormatDelegate.openCourse(navCtrl, course, params);
1012+
10121013
return;
10131014
}
10141015

@@ -1041,6 +1042,8 @@ export class CoreCourseProvider {
10411042
this.domUtils.showConfirm(message, '', reload, ignore).then(() => {
10421043
window.location.reload();
10431044
});
1045+
} finally {
1046+
loading.dismiss();
10441047
}
10451048
}
10461049

0 commit comments

Comments
 (0)