diff --git a/src/views/charts/TvChart.tsx b/src/views/charts/TvChart.tsx index 6f67d44..7fb8df6 100644 --- a/src/views/charts/TvChart.tsx +++ b/src/views/charts/TvChart.tsx @@ -76,6 +76,19 @@ export const TvChart = () => { tvWidget?.activeChart().setVisibleRange(newRange, { percentRightMargin: 10 }); }; + /** + * @description Hook to handle changing chart resolution + */ + useEffect(() => { + if (chartResolution) { + if (chartResolution !== selectedResolution) { + dispatch(setTvChartResolution({ marketId: currentMarketId, resolution: chartResolution })); + } + + setVisibleRangeForResolution({ resolution: chartResolution }); + } + }, [chartResolution]); + /** * @description Hook to handle changing markets */ @@ -191,19 +204,6 @@ export const TvChart = () => { orderLines = {}; }; - /** - * @description Hook to handle changing chart resolution - */ - useEffect(() => { - if (chartResolution) { - if (chartResolution !== selectedResolution) { - dispatch(setTvChartResolution({ marketId: currentMarketId, resolution: chartResolution })); - } - - setVisibleRangeForResolution({ resolution: chartResolution }); - } - }, [chartResolution]); - return ( {!isChartReady && }