MOBILE-2877 data: Check comments disabled on prefetch
parent
e6fd969855
commit
9f51f547c4
|
@ -282,6 +282,7 @@ export class AddonModDataPrefetchHandler extends CoreCourseActivityPrefetchHandl
|
|||
return this.getDatabaseInfoHelper(module, courseId, false, false, true, siteId).then((info) => {
|
||||
// Prefetch the database data.
|
||||
const database = info.database,
|
||||
commentsEnabled = !this.commentsProvider.areCommentsDisabledInSite(),
|
||||
promises = [];
|
||||
|
||||
promises.push(this.dataProvider.getFields(database.id, false, true, siteId));
|
||||
|
@ -295,7 +296,7 @@ export class AddonModDataPrefetchHandler extends CoreCourseActivityPrefetchHandl
|
|||
info.entries.forEach((entry) => {
|
||||
promises.push(this.dataProvider.getEntry(database.id, entry.id, true, siteId));
|
||||
|
||||
if (database.comments) {
|
||||
if (commentsEnabled && database.comments) {
|
||||
promises.push(this.commentsProvider.getComments('module', database.coursemodule, 'mod_data', entry.id,
|
||||
'database_entry', 0, siteId));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue