MOBILE-3833 assign: Invalidate submission component before is null

main
Pau Ferrer Ocaña 2022-02-22 15:34:42 +01:00
parent 97915ddb90
commit 42e3681407
1 changed files with 4 additions and 4 deletions

View File

@ -326,6 +326,8 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo
const promises: Promise<void>[] = [];
promises.push(AddonModAssign.invalidateAssignmentData(this.courseId));
// Invalidate before component becomes null.
promises.push(this.submissionComponent?.invalidateAndRefresh(true) || Promise.resolve());
if (this.assign) {
promises.push(AddonModAssign.invalidateAllSubmissionData(this.assign.id));
@ -335,9 +337,7 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo
}
}
await Promise.all(promises).finally(() => {
this.submissionComponent?.invalidateAndRefresh(true);
});
await Promise.all(promises);
}
/**