fix dependency hook

This commit is contained in:
mulan xia 2024-02-07 16:16:00 -05:00
parent c678d403ac
commit 5959a1cf02
No known key found for this signature in database
GPG Key ID: C6CE526613568D73

View File

@ -97,7 +97,7 @@ export const TvChart = () => {
}
});
});
}, [showOrderLines, currentMarketOrders]);
}, [showOrderLines, currentMarketOrders, isChartReady]);
const drawOrderLines = () => {
const updatedOrderLines: Record<string, IOrderLineAdapter> = {};
@ -131,12 +131,10 @@ export const TvChart = () => {
const { orderColor, borderColor, backgroundColor, textColor, textButtonColor } =
getOrderLineColors({ side: side.rawValue, appTheme, appColorMode });
const orderPrice = triggerPrice ?? price;
const orderLine = tvWidget
?.chart()
.createOrderLine({ disableUndo: false })
.setPrice(MustBigNumber(orderPrice).toNumber())
.setPrice(MustBigNumber(triggerPrice ?? price).toNumber())
.setQuantity(quantity)
.setText(orderString)
.setLineColor(orderColor)