Skip to content

Commit

Permalink
Fix max available balance in redeem view
Browse files Browse the repository at this point in the history
  • Loading branch information
ebma committed Nov 22, 2024
1 parent 11a614d commit fe1fb1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/spacewalk/bridge/Redeem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ function Redeem(props: RedeemProps): JSX.Element {

useEffect(() => {
const selectedAssetName = assetDisplayName(selectedAsset, '', wrappedCurrencySuffix);
const { amount } = balances?.find(({ token }) => token === selectedAssetName) || { amount: 0 };
const { amount } = balances?.find(({ token, asset }) =>
asset && selectedAsset ? asset.equals(selectedAsset) : token === selectedAssetName,
) || {
amount: 0,
};
setSelectedAssetsBalance(amount);
}, [balances, selectedAsset, wrappedCurrencySuffix, selectedAssetsBalance]);

Expand Down

0 comments on commit fe1fb1e

Please sign in to comment.