Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
fix: max spend button
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-thompson authored and bucko13 committed Jan 10, 2024
1 parent cd88354 commit 0884745
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/actions/transactionActions.js
Expand Up @@ -276,10 +276,12 @@ export function setMaxSpendOnOutput(outputIndex) {
new BigNumber(0)
);

const spendAllAmount = satoshisToBitcoins(
new BigNumber(confirmedBalance)
.minus(outputs.length > 1 ? totalOutputValue : 0)
.minus(estimatedFee)
const spendAllAmount = new BigNumber(
satoshisToBitcoins(
new BigNumber(confirmedBalance)
.minus(outputs.length > 1 ? totalOutputValue : 0)
.minus(estimatedFee)
)
);

if (
Expand All @@ -292,7 +294,7 @@ export function setMaxSpendOnOutput(outputIndex) {
"Not enough available funds for max spend. Clear other outputs or wait for incoming deposits to confirm."
)
);
return dispatch(setOutputAmount(outputIndex, spendAllAmount));
return dispatch(setOutputAmount(outputIndex, spendAllAmount.toString()));
};
}

Expand Down

0 comments on commit 0884745

Please sign in to comment.