MOBILE-2512 prefetch: Don't download hidden modules and sections
parent
d5026c5e16
commit
204a1ce8f1
|
@ -1114,6 +1114,11 @@ export class CoreCourseHelperProvider {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (section.hiddenbynumsections) {
|
||||
// Hidden section.
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
section.isDownloading = true;
|
||||
|
||||
// Validate the section needs to be downloaded and calculate amount of modules that need to be downloaded.
|
||||
|
|
|
@ -953,6 +953,11 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate {
|
|||
* @return {Promise<boolean>} Promise resolved with true if downloadable, false otherwise.
|
||||
*/
|
||||
isModuleDownloadable(module: any, courseId: number): Promise<boolean> {
|
||||
if (module.uservisible === false) {
|
||||
// Module isn't visible by the user, cannot be downloaded.
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
const handler = this.getPrefetchHandlerFor(module);
|
||||
|
||||
if (handler) {
|
||||
|
|
Loading…
Reference in New Issue