From 5959a1cf0237cfca61b9bdba476ad0fc329dd3d3 Mon Sep 17 00:00:00 2001 From: mulan xia Date: Wed, 7 Feb 2024 16:16:00 -0500 Subject: [PATCH] fix dependency hook --- src/views/charts/TvChart.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/views/charts/TvChart.tsx b/src/views/charts/TvChart.tsx index 559d952..bac95a4 100644 --- a/src/views/charts/TvChart.tsx +++ b/src/views/charts/TvChart.tsx @@ -97,7 +97,7 @@ export const TvChart = () => { } }); }); - }, [showOrderLines, currentMarketOrders]); + }, [showOrderLines, currentMarketOrders, isChartReady]); const drawOrderLines = () => { const updatedOrderLines: Record = {}; @@ -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)