MOBILE-2466 prefetch: Verify status is valid when prefetching modules
parent
4f636824e3
commit
e69f32b5b7
|
@ -797,7 +797,7 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate {
|
||||||
const packageId = this.filepoolProvider.getPackageId(handler.component, module.id);
|
const packageId = this.filepoolProvider.getPackageId(handler.component, module.id);
|
||||||
|
|
||||||
promises.push(this.getModuleStatus(module, courseId, updates, refresh).then((modStatus) => {
|
promises.push(this.getModuleStatus(module, courseId, updates, refresh).then((modStatus) => {
|
||||||
if (modStatus != CoreConstants.NOT_DOWNLOADABLE) {
|
if (result[modStatus]) {
|
||||||
status = this.filepoolProvider.determinePackagesStatus(status, modStatus);
|
status = this.filepoolProvider.determinePackagesStatus(status, modStatus);
|
||||||
result[modStatus].push(module);
|
result[modStatus].push(module);
|
||||||
result.total++;
|
result.total++;
|
||||||
|
@ -808,8 +808,8 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cacheStatus != CoreConstants.NOT_DOWNLOADABLE) {
|
if (result[cacheStatus]) {
|
||||||
cacheStatus = this.filepoolProvider.determinePackagesStatus(status, cacheStatus);
|
status = this.filepoolProvider.determinePackagesStatus(status, cacheStatus);
|
||||||
result[cacheStatus].push(module);
|
result[cacheStatus].push(module);
|
||||||
result.total++;
|
result.total++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue