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