Skip to content

Commit

Permalink
fix: do not allow max to go below 0
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Jun 5, 2024
1 parent aab5af3 commit 862e078
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/screens/Wallets/LNURLPay/Amount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ const Amount = ({

const max = useMemo(() => {
// TODO: get routing fee
const fee = 100;
return Math.min(spendingBalance - fee, maxSendable);
const fee = 10;
const min = Math.min(spendingBalance - fee, maxSendable);
return min < 0 ? 0 : min;
}, [maxSendable, spendingBalance]);

const maxSendableProps = {
Expand Down

0 comments on commit 862e078

Please sign in to comment.