MOBILE-2915 workshop: Fix asssessment prefetch

main
Pau Ferrer Ocaña 2019-03-29 12:06:09 +01:00
parent 5602e6eeb4
commit e272a39636
1 changed files with 8 additions and 11 deletions

View File

@ -332,17 +332,14 @@ export class AddonModWorkshopPrefetchHandler extends CoreCourseActivityPrefetchH
}); });
} }
if (assessments.length > 0) {
reportPromise = reportPromise.finally(() => { reportPromise = reportPromise.finally(() => {
const promises3 = []; if (assessments.length > 0) {
assessments.forEach((assessment, id) => { return Promise.all(assessments.map((assessment, id) => {
promises3.push(this.workshopProvider.getAssessmentForm(workshop.id, id, undefined, undefined, return this.workshopProvider.getAssessmentForm(workshop.id, id, undefined, undefined, undefined,
undefined, siteId)); siteId);
}); }));
return Promise.all(promises3);
});
} }
});
promises2.push(reportPromise); promises2.push(reportPromise);
if (workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED) { if (workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED) {