mirror of
https://github.com/nasa/openmct.git
synced 2025-04-20 00:51:09 +00:00
[Plot] Avoid exception switching plots
Avoid exception when switching plots by using correct API for unsubscribing. Additionally, clear out series in scope when domain object in view changes. Addresses MissionControl/vista#52
This commit is contained in:
parent
baee0870d3
commit
3bdbf2aa56
@ -13,7 +13,7 @@ define(
|
||||
var plotHistory = [],
|
||||
isLive = true,
|
||||
maxDomain = +new Date(),
|
||||
subscriptions = [],
|
||||
unsubscribes = [],
|
||||
palette = new colorService.ColorPalette();
|
||||
|
||||
|
||||
@ -87,14 +87,15 @@ define(
|
||||
series,
|
||||
seriesIndex
|
||||
);
|
||||
subscriptions.push(telemetryCapability.subscribe(updater));
|
||||
unsubscribes.push(telemetryCapability.subscribe(updater));
|
||||
}
|
||||
|
||||
function unlinkDomainObject() {
|
||||
subscriptions.forEach(function(subscription) {
|
||||
subscription.unsubscribe();
|
||||
$scope.series = [];
|
||||
unsubscribes.forEach(function(unsubscribe) {
|
||||
unsubscribe();
|
||||
});
|
||||
subscriptions = [];
|
||||
unsubscribes = [];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user