Candlestick: re-init config when series length changes (#56913)

This commit is contained in:
Leon Sorokin 2022-10-14 04:12:28 -05:00 committed by GitHub
parent 53ac77d4a5
commit 4eea326ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ export const CandlestickPanel: React.FC<CandlestickPanelProps> = ({
const theme = useTheme2();
const info = useMemo(() => {
return prepareCandlestickFields(data?.series, options, theme, timeRange);
return prepareCandlestickFields(data.series, options, theme, timeRange);
}, [data, options, theme, timeRange]);
const { renderers, tweakScale, tweakAxis } = useMemo(() => {
@ -212,7 +212,7 @@ export const CandlestickPanel: React.FC<CandlestickPanelProps> = ({
tweakAxis,
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [options, data.structureRev]);
}, [options, data.structureRev, data.series.length]);
if (!info) {
return (