Merge pull request #1825 from crazyserver/MOBILE-2915

MOBILE-2915 workshop: Fix asssessment prefetch
main
Juan Leyva 2019-03-29 12:13:53 +01:00 committed by GitHub
commit 6e1e99f806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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(() => {
const promises3 = [];
assessments.forEach((assessment, id) => {
promises3.push(this.workshopProvider.getAssessmentForm(workshop.id, id, undefined, undefined,
undefined, siteId));
});
return Promise.all(promises3);
});
}
reportPromise = reportPromise.finally(() => {
if (assessments.length > 0) {
return Promise.all(assessments.map((assessment, id) => {
return this.workshopProvider.getAssessmentForm(workshop.id, id, undefined, undefined, undefined,
siteId);
}));
}
});
promises2.push(reportPromise);
if (workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED) {