fix trading view flashing when changing markets
This commit is contained in:
parent
b9c8dd09d5
commit
eb81b20e3f
|
@ -80,6 +80,16 @@ const TVChartContainer = () => {
|
|||
|
||||
const tvWidgetRef = useRef<IChartingLibraryWidget | null>(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,
|
||||
|
|
Loading…
Reference in New Issue