fix: pay_invoice timeout to prevent blocking (#2875)

* fix: make invoice non blocking

* fix with vlad

* wallet.js take pending into account

* fixup!

* add check payment to outgoing

* revert

* bundle

* fix: label

* fix: rebase change

* feat: configure pay invoice wait time

* fix: check payment button

* bundle

* fix: task in async context

---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡
2025-02-23 00:02:39 +00:00
committed by GitHub
co-authored by Vlad Stan
parent 2f2a3b1092
commit b06c16ed57
25 changed files with 144 additions and 67 deletions
+17 -12
View File
@@ -463,22 +463,27 @@ window.WalletPageLogic = {
payInvoice() {
const dismissPaymentMsg = Quasar.Notify.create({
timeout: 0,
message: this.$t('processing_payment')
message: this.$t('payment_processing')
})
LNbits.api
.payInvoice(this.g.wallet, this.parse.data.request)
.then(_ => {
clearInterval(this.parse.paymentChecker)
setTimeout(() => {
clearInterval(this.parse.paymentChecker)
}, 40000)
this.parse.paymentChecker = setInterval(() => {
if (!this.parse.show) {
dismissPaymentMsg()
clearInterval(this.parse.paymentChecker)
}
}, 2000)
.then(response => {
dismissPaymentMsg()
this.updatePayments = !this.updatePayments
this.parse.show = false
if (response.data.status == 'success') {
Quasar.Notify.create({
type: 'positive',
message: this.$t('payment_successful')
})
}
if (response.data.status == 'pending') {
Quasar.Notify.create({
type: 'info',
message: this.$t('payment_pending')
})
}
})
.catch(err => {
dismissPaymentMsg()