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)
|
const tvWidgetRef = useRef<IChartingLibraryWidget | null>(null)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (tvWidgetRef.current) {
|
||||||
|
tvWidgetRef.current.setSymbol(
|
||||||
|
selectedMarketConfig.name,
|
||||||
|
defaultProps.interval,
|
||||||
|
() => {}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}, [selectedMarketConfig.name])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const widgetOptions: ChartingLibraryWidgetOptions = {
|
const widgetOptions: ChartingLibraryWidgetOptions = {
|
||||||
symbol: selectedMarketConfig.name,
|
symbol: selectedMarketConfig.name,
|
||||||
|
@ -178,7 +188,7 @@ const TVChartContainer = () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
//eslint-disable-next-line
|
//eslint-disable-next-line
|
||||||
}, [selectedMarketConfig, theme, isMobile])
|
}, [theme, isMobile])
|
||||||
|
|
||||||
const handleCancelOrder = async (
|
const handleCancelOrder = async (
|
||||||
order: Order | PerpOrder | PerpTriggerOrder,
|
order: Order | PerpOrder | PerpTriggerOrder,
|
||||||
|
|
Loading…
Reference in New Issue