code-review-fix task 12.9: add activeChartId to primitive cleanup effect dependency arrays in CandleChart
This commit is contained in:
parent
3f6bcd5c7d
commit
440043518c
1 changed files with 3 additions and 3 deletions
|
|
@ -1072,7 +1072,7 @@ const CandleChart = forwardRef<CandleChartHandle, CandleChartProps>(
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('keydown', handleKeyDown);
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
};
|
};
|
||||||
}, [drawingState]);
|
}, [drawingState, activeChartId]);
|
||||||
|
|
||||||
// Manage TrendLine primitives for saved line annotations
|
// Manage TrendLine primitives for saved line annotations
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -1126,7 +1126,7 @@ const CandleChart = forwardRef<CandleChartHandle, CandleChartProps>(
|
||||||
linePrimitivesRef.current.set(annotation.id, trendLine);
|
linePrimitivesRef.current.set(annotation.id, trendLine);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [annotations, annotationTypes, selectedColor]);
|
}, [annotations, annotationTypes, selectedColor, activeChartId]);
|
||||||
|
|
||||||
// Manage RectangleDrawingPrimitive for saved rectangle annotations
|
// Manage RectangleDrawingPrimitive for saved rectangle annotations
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -1174,7 +1174,7 @@ const CandleChart = forwardRef<CandleChartHandle, CandleChartProps>(
|
||||||
rectanglePrimitivesRef.current.set(annotation.id, rectangle);
|
rectanglePrimitivesRef.current.set(annotation.id, rectangle);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [annotations, annotationTypes, selectedColor]);
|
}, [annotations, annotationTypes, selectedColor, activeChartId]);
|
||||||
|
|
||||||
// Fetch data on mount and when chart switches
|
// Fetch data on mount and when chart switches
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue