Merge pull request #1556 from stackernews/fix-1544

fix invoice status display
This commit is contained in:
Keyan 2024-11-07 19:25:06 -06:00 committed by GitHub
commit e9a5925c50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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