MOBILE-3946 completion: Fix bug detecting automatic completion

main
Dani Palou 2021-12-13 15:07:01 +01:00
parent 09a8d8fead
commit 007fbe0ab2
2 changed files with 3 additions and 7 deletions

View File

@ -362,11 +362,11 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
/**
* Play the package.
*/
play(): void {
async play(): Promise<void> {
this.playing = true;
// Mark the activity as viewed.
AddonModH5PActivity.logView(this.h5pActivity!.id, this.h5pActivity!.name, this.siteId);
await AddonModH5PActivity.logView(this.h5pActivity!.id, this.h5pActivity!.name, this.siteId);
CoreCourse.checkModuleCompletion(this.courseId, this.module.completiondata);
}

View File

@ -203,11 +203,7 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
try {
if (refresh && this.showCompletion) {
try {
this.module = await CoreCourse.getModule(this.module.id, this.courseId);
} catch {
// Ignore errors.
}
await CoreUtils.ignoreErrors(this.fetchModule());
}
await this.fetchContent(refresh, sync, showErrors);