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:
+17
-12
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user