Skip to content

Commit

Permalink
fix: alert on which chain
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Oct 10, 2024
1 parent b105c8c commit 536f470
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/appBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.`}</span>
</div>
);
}
return null;
}, [bridgeInstance, feeBalanceOnSourceChain]);
}, [bridgeInstance, feeBalanceOnSourceChain, sourceChain]);

const existentialAlertOnSourceChain = useMemo(() => {
if (
Expand Down Expand Up @@ -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.`}</span>
</div>
);
}
return null;
}, [targetNativeBalance, existentialDepositOnTargetChain]);
}, [targetNativeBalance, existentialDepositOnTargetChain, targetChain]);

const disabledSend =
!sender?.address ||
Expand Down

0 comments on commit 536f470

Please sign in to comment.