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.
|
* @return True or promise resolved with true if enabled.
|
||||||
*/
|
*/
|
||||||
isEnabled(): boolean | Promise<boolean> {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,14 +83,12 @@ export class CoreCommentsCommentsComponent implements OnChanges, OnDestroy {
|
||||||
// Refresh comments count if event received.
|
// Refresh comments count if event received.
|
||||||
this.commentsCountObserver = eventsProvider.on(CoreCommentsProvider.COMMENTS_COUNT_CHANGED_EVENT, (data) => {
|
this.commentsCountObserver = eventsProvider.on(CoreCommentsProvider.COMMENTS_COUNT_CHANGED_EVENT, (data) => {
|
||||||
// Verify these comments need to be updated.
|
// Verify these comments need to be updated.
|
||||||
if (this.undefinedOrEqual(data, 'contextLevel') && this.undefinedOrEqual(data, 'instanceId') &&
|
if (!this.commentsCount.endsWith('+') && this.undefinedOrEqual(data, 'contextLevel') &&
|
||||||
this.undefinedOrEqual(data, 'component') && this.undefinedOrEqual(data, 'itemId') &&
|
this.undefinedOrEqual(data, 'instanceId') && this.undefinedOrEqual(data, 'component') &&
|
||||||
this.undefinedOrEqual(data, 'area') && !this.countError) {
|
this.undefinedOrEqual(data, 'itemId') && this.undefinedOrEqual(data, 'area') && !this.countError) {
|
||||||
if (!this.commentsCount.endsWith('+')) {
|
|
||||||
// Parse and unparse string.
|
// Parse and unparse string.
|
||||||
this.commentsCount = parseInt(this.commentsCount, 10) + data.countChange + '';
|
this.commentsCount = parseInt(this.commentsCount, 10) + data.countChange + '';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, sitesProvider.getCurrentSiteId());
|
}, sitesProvider.getCurrentSiteId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue