From 681ffef1d3b123456df57a86592555e5ef362bc7 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Mon, 26 Oct 2015 14:53:40 -0700 Subject: [PATCH] [PlotReborn] Subscribe to realtime after historical load To prevent realtime data being displayed before historical has loaded, subscribe to realtime after historical loads. --- .../src/controllers/PlotController.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/platform/features/plot-reborn/src/controllers/PlotController.js b/platform/features/plot-reborn/src/controllers/PlotController.js index 06c06aac4d..191c18a22b 100644 --- a/platform/features/plot-reborn/src/controllers/PlotController.js +++ b/platform/features/plot-reborn/src/controllers/PlotController.js @@ -94,12 +94,13 @@ define( } function startRealTimeFeed(series, seriesIndex, telemetryCapability) { - var updater = addTelemetrySeriesToPlotSeries( - series, - seriesIndex - ); - unsubscribes.push(telemetryCapability.subscribe(updater)); - return; + return function () { + var updater = addTelemetrySeriesToPlotSeries( + series, + seriesIndex + ); + unsubscribes.push(telemetryCapability.subscribe(updater)); + }; } function subscribeToDomainObject(domainObject) { @@ -118,7 +119,8 @@ define( $scope.series.push(series); seriesIndex = $scope.series.indexOf(series); - return telemetryCapability.requestData({}) + return telemetryCapability + .requestData({}) .then(addTelemetrySeriesToPlotSeries( series, seriesIndex