diff --git a/components/TradingView/index.tsx b/components/TradingView/index.tsx index 996facda..15094a91 100755 --- a/components/TradingView/index.tsx +++ b/components/TradingView/index.tsx @@ -80,6 +80,16 @@ const TVChartContainer = () => { const tvWidgetRef = useRef(null) + useEffect(() => { + if (tvWidgetRef.current) { + tvWidgetRef.current.setSymbol( + selectedMarketConfig.name, + defaultProps.interval, + () => {} + ) + } + }, [selectedMarketConfig.name]) + useEffect(() => { const widgetOptions: ChartingLibraryWidgetOptions = { symbol: selectedMarketConfig.name, @@ -178,7 +188,7 @@ const TVChartContainer = () => { }) }) //eslint-disable-next-line - }, [selectedMarketConfig, theme, isMobile]) + }, [theme, isMobile]) const handleCancelOrder = async ( order: Order | PerpOrder | PerpTriggerOrder,