Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Fix amount calculation in send max when fees exceed spendable amount (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelnguyen authored and lambertkevin committed Apr 21, 2022
1 parent 973ac23 commit f4067a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/families/celo/js-getTransactionStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ const getTransactionStatus = async (

const estimatedFees = transaction.fees || new BigNumber(0);

const amount = useAllAmount
let amount = useAllAmount
? account.spendableBalance.minus(estimatedFees)
: new BigNumber(transaction.amount);

if (amount.lt(0)) amount = new BigNumber(0);

if (amount.lte(0) && !transaction.useAllAmount) {
errors.amount = new AmountRequired();
}
Expand Down

0 comments on commit f4067a1

Please sign in to comment.