Merge pull request #2786 from nasa/issue-2773

[Conditions] cleanup subscriptions in style rule manager
This commit is contained in:
Shefali Joshi 2020-03-26 09:53:16 -07:00 committed by GitHub
commit de8f8088e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,8 @@ export default class StyleRuleManager extends EventEmitter {
this.stopProvidingTelemetry();
}
this.openmct.objects.get(this.conditionSetIdentifier).then((conditionSetDomainObject) => {
this.openmct.telemetry.request(conditionSetDomainObject)
.then(output => this.handleConditionSetResultUpdated(output));
this.stopProvidingTelemetry = this.openmct.telemetry.subscribe(conditionSetDomainObject, output => this.handleConditionSetResultUpdated(output));
});
}
@ -115,6 +117,7 @@ export default class StyleRuleManager extends EventEmitter {
if (this.stopProvidingTelemetry) {
this.stopProvidingTelemetry();
}
delete this.stopProvidingTelemetry;
this.conditionSetIdentifier = undefined;
}