handle trading view errors when changing markets
This commit is contained in:
parent
f91b78424d
commit
3664a30462
|
@ -95,14 +95,18 @@ const TradingViewChart = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const group = mangoStore.getState().group
|
const group = mangoStore.getState().group
|
||||||
if (tvWidgetRef.current && chartReady && selectedMarketName && group) {
|
if (tvWidgetRef.current && chartReady && selectedMarketName && group) {
|
||||||
const market = group.getSerum3MarketByName(selectedMarketName)
|
try {
|
||||||
tvWidgetRef.current.setSymbol(
|
const market = group.getSerum3MarketByName(selectedMarketName)
|
||||||
market?.serumMarketExternal.toString(),
|
tvWidgetRef.current.setSymbol(
|
||||||
tvWidgetRef.current.activeChart().resolution(),
|
market?.serumMarketExternal.toString(),
|
||||||
() => {
|
tvWidgetRef.current.activeChart().resolution(),
|
||||||
return
|
() => {
|
||||||
}
|
return
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Trading View change symbol error: ', e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [selectedMarketName, chartReady])
|
}, [selectedMarketName, chartReady])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue