Skip to content

Commit

Permalink
Fix string parsed number
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamboster committed Oct 5, 2022
1 parent 61524bd commit e06d651
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/navigation/services/swap-crypto/screens/SwapCryptoRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ const SwapCryptoRoot: React.FC = () => {
}
}
}
// updateReceivingAmount();
updateReceivingAmount();
})
.catch(err => {
logger.error('Changelly getPairsParams Error: ' + JSON.stringify(err));
Expand Down Expand Up @@ -1178,7 +1178,9 @@ const SwapCryptoRoot: React.FC = () => {
isVisible={amountModalVisible}
modalTitle={t('Swap Amount')}
swapOpts={{
maxWalletAmount: fromWalletSelected?.balance?.cryptoSpendable,
// @ts-ignore
maxWalletAmount:
fromWalletSelected?.balance?.cryptoSpendable?.replaceAll(',', ''),
swapLimits,
}}
cryptoCurrencyAbbreviation={fromWalletData?.currencyAbbreviation.toUpperCase()}
Expand All @@ -1202,7 +1204,10 @@ const SwapCryptoRoot: React.FC = () => {
if (IsERCToken(fromWalletSelected.currencyAbbreviation)) {
setUseSendMax(true);
setSendMaxInfo(undefined);
newAmount = Number(fromWalletSelected.balance.cryptoSpendable);
newAmount = Number(
// @ts-ignore
fromWalletSelected.balance.cryptoSpendable.replaceAll(',', ''),
);
} else {
setUseSendMax(true);
const data = await getSendMaxData();
Expand Down

0 comments on commit e06d651

Please sign in to comment.