diff --git a/src/core/course/classes/main-resource-component.ts b/src/core/course/classes/main-resource-component.ts index 5d753824f..7e2837ba7 100644 --- a/src/core/course/classes/main-resource-component.ts +++ b/src/core/course/classes/main-resource-component.ts @@ -41,7 +41,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, size: string; // Used when calling fillContextMenu. protected isDestroyed; // Whether the component is destroyed, used when calling fillContextMenu. - protected statusObserver; // Observer of package status changed, used when calling fillContextMenu. + protected contextMenuStatusObserver; // Observer of package status changed, used when calling fillContextMenu. protected fetchContentDefaultError = 'core.course.errorgetmodule'; // Default error to show when loading contents. protected isCurrentView: boolean; // Whether the component is in the current view. @@ -193,7 +193,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, */ ngOnDestroy(): void { this.isDestroyed = true; - this.statusObserver && this.statusObserver.off(); + this.contextMenuStatusObserver && this.contextMenuStatusObserver.off(); } /** diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 11d5a869f..99aed6fd0 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -719,8 +719,8 @@ export class CoreCourseHelperProvider { } } - if (typeof instance.statusObserver == 'undefined' && component) { - instance.statusObserver = this.eventsProvider.on(CoreEventsProvider.PACKAGE_STATUS_CHANGED, (data) => { + if (typeof instance.contextMenuStatusObserver == 'undefined' && component) { + instance.contextMenuStatusObserver = this.eventsProvider.on(CoreEventsProvider.PACKAGE_STATUS_CHANGED, (data) => { if (data.componentId == module.id && data.component == component) { this.fillContextMenu(instance, module, courseId, false, component); }