commit
5841425b6b
|
@ -363,7 +363,9 @@ export class AddonModWorkshopPrefetchHandler extends CoreCourseActivityPrefetchH
|
||||||
});
|
});
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// Prefetch user profiles.
|
// Prefetch user profiles.
|
||||||
return this.userProvider.prefetchProfiles(userIds, courseId, siteId);
|
return this.userProvider.prefetchProfiles(userIds, courseId, siteId).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1114,6 +1114,11 @@ export class CoreCourseHelperProvider {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (section.hiddenbynumsections) {
|
||||||
|
// Hidden section.
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
section.isDownloading = true;
|
section.isDownloading = true;
|
||||||
|
|
||||||
// Validate the section needs to be downloaded and calculate amount of modules that need to be downloaded.
|
// 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.
|
* @return {Promise<boolean>} Promise resolved with true if downloadable, false otherwise.
|
||||||
*/
|
*/
|
||||||
isModuleDownloadable(module: any, courseId: number): Promise<boolean> {
|
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);
|
const handler = this.getPrefetchHandlerFor(module);
|
||||||
|
|
||||||
if (handler) {
|
if (handler) {
|
||||||
|
|
|
@ -383,6 +383,10 @@ export class CoreUserProvider {
|
||||||
promises = [];
|
promises = [];
|
||||||
|
|
||||||
userIds.forEach((userId) => {
|
userIds.forEach((userId) => {
|
||||||
|
if (userId === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
userId = Number(userId); // Make sure it's a number.
|
userId = Number(userId); // Make sure it's a number.
|
||||||
|
|
||||||
// Prevent repeats and errors.
|
// Prevent repeats and errors.
|
||||||
|
|
Loading…
Reference in New Issue