diff --git a/screens/Trading/components/TradingOperate.tsx b/screens/Trading/components/TradingOperate.tsx index 369307da..371426d7 100644 --- a/screens/Trading/components/TradingOperate.tsx +++ b/screens/Trading/components/TradingOperate.tsx @@ -57,7 +57,8 @@ const TradingOperate: React.FC = ({ onMobileClose, id }) => const [activeTab, setActiveTab] = useState(ReduxActiveTab || "long"); const [estimateLoading, setEstimateLoading] = useState(false); const [selectedSetUpOption, setSelectedSetUpOption] = useState("custom"); - const [isConfirmModalOpen, setIsConfirmModalOpen] = useState(false); + const [isLongConfirmModalOpen, setIsLongConfirmModalOpen] = useState(false); + const [isShortConfirmModalOpen, setIsShortConfirmModalOpen] = useState(false); const [rangeMount, setRangeMount] = useState(ReduxRangeMount || 1); const [isDisabled, setIsDisabled] = useState(false); const [longInput, setLongInput] = useState(""); @@ -353,8 +354,6 @@ const TradingOperate: React.FC = ({ onMobileClose, id }) => shortInput, ], ); - console.log("-----------ReduxcategoryAssets1", ReduxcategoryAssets1); - const setOwnBanlance = (key: string) => { if (activeTab === "long") { setLongInput(key); @@ -413,7 +412,11 @@ const TradingOperate: React.FC = ({ onMobileClose, id }) => // open position btn click eve. const handleConfirmButtonClick = () => { if (isDisabled) return; - setIsConfirmModalOpen(true); + if (activeTab == "long") { + setIsLongConfirmModalOpen(true); + } else if (activeTab == "short") { + setIsShortConfirmModalOpen(true); + } }; const isValidDecimalString = (str) => { @@ -490,7 +493,6 @@ const TradingOperate: React.FC = ({ onMobileClose, id }) => setLiqPrice(""); setTokenInAmount(0); } else if (tab === "long") { - console.log("......", estimateData?.amount_out); outputSetter(+(estimateData?.amount_out || 0)); outputUsdSetter(inputUsdCharcate * +(estimateData?.amount_out || 0)); } else if (tab === "short") { @@ -764,11 +766,11 @@ const TradingOperate: React.FC = ({ onMobileClose, id }) => ) : ( )} - {isConfirmModalOpen && ( + {isLongConfirmModalOpen && ( { - setIsConfirmModalOpen(false); + setIsLongConfirmModalOpen(false); if (onMobileClose) onMobileClose(); }} action="Long" @@ -896,11 +898,11 @@ const TradingOperate: React.FC = ({ onMobileClose, id }) => ) : ( )} - {isConfirmModalOpen && ( + {isShortConfirmModalOpen && ( { - setIsConfirmModalOpen(false); + setIsShortConfirmModalOpen(false); if (onMobileClose) onMobileClose(); }} action="Short"