Remove unsubscribe callback

This commit is contained in:
Andrew Henry 2020-07-10 15:10:33 -07:00
parent bacad24811
commit 98db273f5d
3 changed files with 11 additions and 1 deletions

View File

@ -46,6 +46,7 @@ export default class StyleRuleManager extends EventEmitter {
if (this.isEditing) { if (this.isEditing) {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
if (this.conditionSetIdentifier) { if (this.conditionSetIdentifier) {
this.applySelectedConditionStyle(); this.applySelectedConditionStyle();
@ -66,6 +67,7 @@ export default class StyleRuleManager extends EventEmitter {
subscribeToConditionSet() { subscribeToConditionSet() {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
this.openmct.objects.get(this.conditionSetIdentifier).then((conditionSetDomainObject) => { this.openmct.objects.get(this.conditionSetIdentifier).then((conditionSetDomainObject) => {
this.openmct.telemetry.request(conditionSetDomainObject) this.openmct.telemetry.request(conditionSetDomainObject)
@ -154,8 +156,8 @@ export default class StyleRuleManager extends EventEmitter {
this.applyStaticStyle(); this.applyStaticStyle();
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
delete this.stopProvidingTelemetry;
this.conditionSetIdentifier = undefined; this.conditionSetIdentifier = undefined;
} }

View File

@ -197,6 +197,7 @@ export default {
} }
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
}, },
initialize(conditionSetDomainObject) { initialize(conditionSetDomainObject) {
@ -210,6 +211,7 @@ export default {
if (this.isEditing) { if (this.isEditing) {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
} else { } else {
this.subscribeToConditionSet(); this.subscribeToConditionSet();
@ -307,6 +309,7 @@ export default {
this.persist(domainObjectStyles); this.persist(domainObjectStyles);
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
}, },
updateDomainObjectItemStyles(newItems) { updateDomainObjectItemStyles(newItems) {
@ -375,6 +378,7 @@ export default {
subscribeToConditionSet() { subscribeToConditionSet() {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
if (this.conditionSetDomainObject) { if (this.conditionSetDomainObject) {
this.openmct.telemetry.request(this.conditionSetDomainObject) this.openmct.telemetry.request(this.conditionSetDomainObject)

View File

@ -190,6 +190,7 @@ export default {
if (this.isEditing) { if (this.isEditing) {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
} else { } else {
this.subscribeToConditionSet(); this.subscribeToConditionSet();
@ -325,6 +326,7 @@ export default {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
if (this.unObserveObjects) { if (this.unObserveObjects) {
@ -337,6 +339,7 @@ export default {
subscribeToConditionSet() { subscribeToConditionSet() {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
if (this.conditionSetDomainObject) { if (this.conditionSetDomainObject) {
this.openmct.telemetry.request(this.conditionSetDomainObject) this.openmct.telemetry.request(this.conditionSetDomainObject)
@ -494,6 +497,7 @@ export default {
if (this.stopProvidingTelemetry) { if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry(); this.stopProvidingTelemetry();
delete this.stopProvidingTelemetry;
} }
}, },
removeConditionalStyles(domainObjectStyles, itemId) { removeConditionalStyles(domainObjectStyles, itemId) {