Compare commits
3 commits
d8cdc1e680
...
51a5adf540
| Author | SHA1 | Date | |
|---|---|---|---|
| 51a5adf540 | |||
| 85c7e13a27 | |||
|
|
e4eafa4528 |
3 changed files with 8 additions and 7 deletions
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -308,16 +308,17 @@ window.PageWallet = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if invoice is amountless (no amount specified)
|
// Check if invoice is amountless (no amount specified)
|
||||||
|
// The decoder returns 'Any amount' string for amountless invoices
|
||||||
|
const invoiceAmount = invoice.human_readable_part.amount
|
||||||
const isAmountless =
|
const isAmountless =
|
||||||
!invoice.human_readable_part.amount ||
|
typeof invoiceAmount !== 'number' || invoiceAmount <= 0
|
||||||
invoice.human_readable_part.amount === 0
|
|
||||||
|
|
||||||
let cleanInvoice = {
|
let cleanInvoice = {
|
||||||
msat: isAmountless ? null : invoice.human_readable_part.amount,
|
msat: isAmountless ? null : invoiceAmount,
|
||||||
sat: isAmountless ? null : invoice.human_readable_part.amount / 1000,
|
sat: isAmountless ? null : invoiceAmount / 1000,
|
||||||
fsat: isAmountless
|
fsat: isAmountless
|
||||||
? this.$t('any_amount')
|
? this.$t('any_amount')
|
||||||
: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000),
|
: LNbits.utils.formatSat(invoiceAmount / 1000),
|
||||||
bolt11: this.parse.data.request,
|
bolt11: this.parse.data.request,
|
||||||
isAmountless: isAmountless
|
isAmountless: isAmountless
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue