diff --git a/packages/augur-simplified/src/modules/common/charts.tsx b/packages/augur-simplified/src/modules/common/charts.tsx index 83078b8b22..bb81f86841 100644 --- a/packages/augur-simplified/src/modules/common/charts.tsx +++ b/packages/augur-simplified/src/modules/common/charts.tsx @@ -188,7 +188,6 @@ export const PriceHistoryChart = ({ cash, }) => { const container = useRef(null); - // eslint-disable-next-line const { maxPriceBigNumber: maxPrice, minPriceBigNumber: minPrice } = market; const { priceTimeArray } = processPriceTimeData( formattedOutcomes, @@ -234,11 +233,9 @@ export const PriceHistoryChart = ({ }, [selectedOutcomes, options, priceTimeArray]); useEffect(() => { + // set no data chart and cleanup chart on dismount const chartContainer = container.current; - NoDataToDisplay(Highcharts); - const chart: HighcartsChart = Highcharts.charts.find( - (chart: HighcartsChart) => chart?.renderTo === chartContainer - ); + NoDataToDisplay(Highcharts); return () => { Highcharts.charts .find((chart: HighcartsChart) => chart?.renderTo === chartContainer)