From 536f470d0e5ea55d343594937556027b397aaf63 Mon Sep 17 00:00:00 2001 From: JayJay1024 Date: Thu, 10 Oct 2024 18:22:15 +0800 Subject: [PATCH] fix: alert on which chain --- src/components/appBox.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/appBox.tsx b/src/components/appBox.tsx index ed6391a..0ef5d76 100644 --- a/src/components/appBox.tsx +++ b/src/components/appBox.tsx @@ -87,9 +87,6 @@ export default function AppBox() { updateTargetNativeBalance, ]); - const sourceChainRef = useRef(sourceChain); - const targetChainRef = useRef(targetChain); - const cross = bridgeInstance?.getCrossInfo(); const assetLimit = assetLimitOnTargetChain?.amount; const assetSupply = targetAssetSupply?.amount; @@ -166,13 +163,13 @@ export default function AppBox() { fee.amount, feeBalanceOnSourceChain.currency.decimals, )} ${feeBalanceOnSourceChain.currency.symbol} in your Sender on ${ - sourceChainRef.current.name + sourceChain.name } to cover cross-chain fees.`} ); } return null; - }, [bridgeInstance, feeBalanceOnSourceChain]); + }, [bridgeInstance, feeBalanceOnSourceChain, sourceChain]); const existentialAlertOnSourceChain = useMemo(() => { if ( @@ -214,13 +211,13 @@ export default function AppBox() { existentialDepositOnTargetChain.amount, existentialDepositOnTargetChain.currency.decimals, )} ${existentialDepositOnTargetChain.currency.symbol} in your Recipient on ${ - targetChainRef.current.name + targetChain.name } to keep an account open.`} ); } return null; - }, [targetNativeBalance, existentialDepositOnTargetChain]); + }, [targetNativeBalance, existentialDepositOnTargetChain, targetChain]); const disabledSend = !sender?.address ||