Skip to content

Commit

Permalink
ensure selectedDetectorIndex is passed to chart correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Apr 1, 2024
1 parent 9c7aeac commit 7291c39
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const EmbeddableSingleMetricViewerContainer: FC<
const [chartWidth, setChartWidth] = useState<number>(0);
const [zoom, setZoom] = useState<AppStateZoom | undefined>();
const [selectedForecastId, setSelectedForecastId] = useState<string | undefined>();
const [detectorIndex, setDetectorIndex] = useState<number>(0);
const [selectedJob, setSelectedJob] = useState<MlJob | undefined>();
const [autoZoomDuration, setAutoZoomDuration] = useState<number | undefined>();
const [jobsLoaded, setJobsLoaded] = useState(false);
Expand Down Expand Up @@ -140,10 +139,6 @@ export const EmbeddableSingleMetricViewerContainer: FC<
*/

switch (action) {
case APP_STATE_ACTION.SET_DETECTOR_INDEX:
setDetectorIndex(payload);
break;

case APP_STATE_ACTION.SET_FORECAST_ID:
setSelectedForecastId(payload);
setZoom(undefined);
Expand All @@ -159,7 +154,7 @@ export const EmbeddableSingleMetricViewerContainer: FC<
}
},

[setZoom, setDetectorIndex, setSelectedForecastId]
[setZoom, setSelectedForecastId]
);

const containerPadding = 10;
Expand Down Expand Up @@ -191,7 +186,7 @@ export const EmbeddableSingleMetricViewerContainer: FC<
lastRefresh={lastRefresh ?? 0}
previousRefresh={previousRefresh}
selectedJobId={selectedJobId}
selectedDetectorIndex={detectorIndex}
selectedDetectorIndex={data.selectedDetectorIndex}
selectedEntities={data.selectedEntities}
selectedForecastId={selectedForecastId}
tableInterval="auto"
Expand Down

0 comments on commit 7291c39

Please sign in to comment.