MOBILE-2877 assign: Leave feedback comment enabled
parent
85b4395909
commit
f16042ee7d
|
@ -183,6 +183,9 @@ export class AddonModAssignFeedbackCommentsHandler implements AddonModAssignFeed
|
|||
* @return True or promise resolved with true if enabled.
|
||||
*/
|
||||
isEnabled(): boolean | Promise<boolean> {
|
||||
// In here we should check if comments is not disabled in site.
|
||||
// But due to this is not a common comments place and it can be disabled separately into Moodle (disabling the plugin).
|
||||
// We are leaving it always enabled. It's also a teacher's feature.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,8 +81,8 @@ export class AddonModGlossaryEntryPage {
|
|||
if (this.glossary && this.glossary.allowcomments && this.entry && this.entry.id > 0 && this.commentsEnabled &&
|
||||
this.comments) {
|
||||
// Refresh comments. Don't add it to promises because we don't want the comments fetch to block the entry fetch.
|
||||
this.comments.doRefresh().catch(() => {
|
||||
// Ignore errors.
|
||||
this.comments.doRefresh().catch(() => {
|
||||
// Ignore errors.
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -83,13 +83,11 @@ export class CoreCommentsCommentsComponent implements OnChanges, OnDestroy {
|
|||
// Refresh comments count if event received.
|
||||
this.commentsCountObserver = eventsProvider.on(CoreCommentsProvider.COMMENTS_COUNT_CHANGED_EVENT, (data) => {
|
||||
// Verify these comments need to be updated.
|
||||
if (this.undefinedOrEqual(data, 'contextLevel') && this.undefinedOrEqual(data, 'instanceId') &&
|
||||
this.undefinedOrEqual(data, 'component') && this.undefinedOrEqual(data, 'itemId') &&
|
||||
this.undefinedOrEqual(data, 'area') && !this.countError) {
|
||||
if (!this.commentsCount.endsWith('+')) {
|
||||
// Parse and unparse string.
|
||||
this.commentsCount = parseInt(this.commentsCount, 10) + data.countChange + '';
|
||||
}
|
||||
if (!this.commentsCount.endsWith('+') && this.undefinedOrEqual(data, 'contextLevel') &&
|
||||
this.undefinedOrEqual(data, 'instanceId') && this.undefinedOrEqual(data, 'component') &&
|
||||
this.undefinedOrEqual(data, 'itemId') && this.undefinedOrEqual(data, 'area') && !this.countError) {
|
||||
// Parse and unparse string.
|
||||
this.commentsCount = parseInt(this.commentsCount, 10) + data.countChange + '';
|
||||
}
|
||||
}, sitesProvider.getCurrentSiteId());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue