Summary widget unsubscribe ()

* Delete subscription handle to prevent double unsubscribe error

* Do not attempt to render undefined telemetry datum
This commit is contained in:
Andrew Henry 2019-04-08 22:02:40 -07:00 committed by Deep Tailor
parent b7fa5c7ba8
commit 40d54df567
3 changed files with 6 additions and 2 deletions

@ -237,6 +237,7 @@ define ([
});
delete this.compositionObjs[objectId];
this.subscriptions[objectId](); //unsubscribe from telemetry source
delete this.subscriptions[objectId];
this.eventEmitter.emit('remove', identifier);
if (_.isEmpty(this.compositionObjs)) {

@ -43,7 +43,7 @@ define([
return evaluator.requestLatest(options)
.then(function (latestDatum) {
this.pool.release(evaluator);
return [latestDatum];
return latestDatum ? [latestDatum] : [];
}.bind(this));
};

@ -52,7 +52,10 @@ define([
strategy: 'latest',
size: 1
}).then(function (results) {
if (this.destroyed || this.hasUpdated || this.renderTracker !== renderTracker) {
if (this.destroyed ||
this.hasUpdated ||
this.renderTracker !== renderTracker ||
results.length === 0) {
return;
}
this.updateState(results[results.length - 1]);