Skip to content

Commit

Permalink
fix: calculations on QuickConfirm screen
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Jun 3, 2024
1 parent 451595c commit 9d434cc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/screens/Lightning/QuickConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ const QuickConfirm = ({
const isTransferToSavings = spendingAmount < lightningBalance;
const txFee = fiatTransactionFee.fiatValue;
const lspFee = purchaseFeeValue.fiatValue - clientBalance.fiatValue;
const totalBalance = onchainBalance + lightningBalance;
const savingsAmount = totalBalance - spendingAmount;

const savingsAmount = onchainBalance - spendingAmount;
const spendingPercentage =
Math.round((spendingAmount / onchainBalance) * 100) || 0;
const savingsPercentage =
Math.round((savingsAmount / onchainBalance) * 100) || 0;
const spendingPercentage = Math.round((spendingAmount / totalBalance) * 100);
const savingsPercentage = Math.round((savingsAmount / totalBalance) * 100);

const handleConfirm = async (): Promise<void> => {
setLoading(true);
Expand Down

0 comments on commit 9d434cc

Please sign in to comment.