Change UI for Pay Invoice Dialog (#2979)

This commit is contained in:
Tiago Vasconcelos
2025-02-18 18:42:46 +02:00
committed by GitHub
parent 0cd94e654e
commit 4afe6dbd6d
2 changed files with 173 additions and 24 deletions
+17 -1
View File
@@ -420,7 +420,8 @@ window.WalletPageLogic = {
let cleanInvoice = {
msat: invoice.human_readable_part.amount,
sat: invoice.human_readable_part.amount / 1000,
fsat: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000)
fsat: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000),
bolt11: this.parse.data.request
}
_.each(invoice.data.tags, tag => {
@@ -433,15 +434,30 @@ window.WalletPageLogic = {
const expireDate = new Date(
(invoice.data.time_stamp + tag.value) * 1000
)
const createdDate = new Date(invoice.data.time_stamp * 1000)
cleanInvoice.expireDate = Quasar.date.formatDate(
expireDate,
'YYYY-MM-DDTHH:mm:ss.SSSZ'
)
cleanInvoice.createdDate = Quasar.date.formatDate(
createdDate,
'YYYY-MM-DDTHH:mm:ss.SSSZ'
)
cleanInvoice.expireDateFrom = moment(expireDate).fromNow()
cleanInvoice.createdDateFrom = moment(createdDate).fromNow()
cleanInvoice.expired = false // TODO
}
}
})
if (this.g.wallet.currency) {
cleanInvoice.fiatAmount = LNbits.utils.formatCurrency(
((cleanInvoice.sat / 1e8) * this.g.exchangeRate).toFixed(2),
this.g.wallet.currency
)
}
this.parse.invoice = Object.freeze(cleanInvoice)
},
payInvoice() {