Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
fix: Amount logic in payment outcome(#449)
Browse files Browse the repository at this point in the history
Changed the logic for usdValueInSats to that of a ternary operator to reduce the need to call the satToUsd function to get the dollar equivalent in Sats
  • Loading branch information
Toheeb-Ojuolape authored Apr 13, 2023
1 parent b6415ec commit 15f14bc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions components/PaymentOutcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ function PaymentOutcome({ paymentRequest, paymentAmount, dispatch }: Props) {
if (data) {
const { status, errors } = data.lnInvoicePaymentStatus
if (status === "PAID") {
const usdValueInSatUnit =
satsToUsd(Number(paymentAmount)) < 1
? "less than a cent"
: `$${satsToUsd(Number(paymentAmount)).toFixed(2)}`
const usdValueInSatUnit = amount === "0.00" ? "less than 1 cent" : `$ ${amount}`
return (
<div className={styles.container}>
<div aria-labelledby="Payment successful">
Expand Down

0 comments on commit 15f14bc

Please sign in to comment.