MOBILE-4069 core: Fix getModuleUpdates if not downloaded

main
Dani Palou 2022-07-14 09:10:14 +02:00
parent 5630f5b054
commit 9a5231d481
1 changed files with 10 additions and 6 deletions

View File

@ -772,13 +772,17 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo
return { status: CoreConstants.NOT_DOWNLOADABLE };
}
// Get the stored data to get the status and downloadTime.
const data = await CoreFilepool.getPackageData(siteId, handler.component, module.id);
try {
// Get the stored data to get the status and downloadTime.
const data = await CoreFilepool.getPackageData(siteId, handler.component, module.id);
return {
status: data.status || CoreConstants.NOT_DOWNLOADED,
downloadTime: data.downloadTime || 0,
};
return {
status: data.status || CoreConstants.NOT_DOWNLOADED,
downloadTime: data.downloadTime || 0,
};
} catch {
return { status: CoreConstants.NOT_DOWNLOADED };
}
}
/**