File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
public/pages/AnomalyCharts/containers Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,22 @@ export const AnomalyHeatmapChart = React.memo(
230230 } ;
231231
232232 // Custom hook to refresh all of the heatmap data when running a historical task
233+ //
234+ // TODO: this hook is actually getting updated more often than just when there
235+ // is a change to the props.detectorTaskProgress. This is due to a remounting
236+ // issue that is triggering this after every AnomaliesChart re-render. More details here:
237+ // https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/issues/90
233238 useEffect ( ( ) => {
234239 if ( props . isHistorical ) {
235240 const updateHeatmapPlotData = getAnomaliesHeatmapData (
236241 props . anomalies ,
237242 props . dateRange ,
238243 sortByFieldValue ,
239- get ( COMBINED_OPTIONS . options [ 0 ] , 'value' )
244+ get (
245+ currentViewOptions [ 0 ] ,
246+ 'value' ,
247+ get ( COMBINED_OPTIONS . options [ 0 ] , 'value' )
248+ )
240249 ) ;
241250 setOriginalHeatmapData ( updateHeatmapPlotData ) ;
242251 setHeatmapData ( updateHeatmapPlotData ) ;
You can’t perform that action at this time.
0 commit comments