socket reruns

This commit is contained in:
Boki 2025-07-04 17:04:47 -04:00
parent a876f3c35b
commit 11c6c19628
29 changed files with 3921 additions and 233 deletions

View file

@ -335,8 +335,13 @@ export function Chart({
// Cleanup
return () => {
window.removeEventListener('resize', handleResize);
if (chart) {
chart.remove();
// Clear all refs before removing the chart
mainSeriesRef.current = null;
volumeSeriesRef.current = null;
overlaySeriesRef.current.clear();
if (chartRef.current) {
chartRef.current.remove();
chartRef.current = null;
}
};
}, [data, height, type, showVolume, theme, overlayData, tradeMarkers]);