fix invoice status display

This commit is contained in:
k00b 2024-11-07 19:10:49 -06:00
parent 0891e51c9e
commit 544a54399c
1 changed files with 7 additions and 7 deletions

View File

@ -55,11 +55,15 @@ export default function Invoice ({
let variant = 'default'
let status = 'waiting for you'
if (invoice.cancelled) {
if (invoice.confirmedAt) {
variant = 'confirmed'
status = `${numWithUnits(invoice.satsReceived, { abbreviate: false })} ${successVerb}`
useWallet = false
} else if (invoice.cancelled) {
variant = 'failed'
status = 'cancelled'
useWallet = false
} else if (invoice.isHeld && invoice.satsReceived && !expired) {
} else if (invoice.isHeld) {
variant = 'pending'
status = (
<div className='d-flex justify-content-center'>
@ -67,15 +71,11 @@ export default function Invoice ({
</div>
)
useWallet = false
} else if (invoice.confirmedAt) {
variant = 'confirmed'
status = `${numWithUnits(invoice.satsReceived, { abbreviate: false })} ${successVerb}`
useWallet = false
} else if (expired) {
variant = 'failed'
status = 'expired'
useWallet = false
} else if (invoice.expiresAt) {
} else {
variant = 'pending'
status = (
<CompactLongCountdown