mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 20:36:16 +02:00
Update payments on invoice creation (#1782)
* update payments on invoice creation * remove unnecessary payment polling
This commit is contained in:
@@ -313,7 +313,6 @@ new Vue({
|
|||||||
this.receive.data.amount = null
|
this.receive.data.amount = null
|
||||||
this.receive.data.memo = null
|
this.receive.data.memo = null
|
||||||
this.receive.unit = 'sat'
|
this.receive.unit = 'sat'
|
||||||
this.receive.paymentChecker = null
|
|
||||||
this.receive.minMax = [0, 2100000000000000]
|
this.receive.minMax = [0, 2100000000000000]
|
||||||
this.receive.lnurl = null
|
this.receive.lnurl = null
|
||||||
this.focusInput('setAmount')
|
this.focusInput('setAmount')
|
||||||
@@ -357,11 +356,6 @@ new Vue({
|
|||||||
LNbits.utils.notifyApiError(error)
|
LNbits.utils.notifyApiError(error)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeReceiveDialog: function () {
|
|
||||||
setTimeout(() => {
|
|
||||||
clearInterval(this.receive.paymentChecker)
|
|
||||||
}, 10000)
|
|
||||||
},
|
|
||||||
closeParseDialog: function () {
|
closeParseDialog: function () {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
clearInterval(this.parse.paymentChecker)
|
clearInterval(this.parse.paymentChecker)
|
||||||
@@ -374,7 +368,6 @@ new Vue({
|
|||||||
if (this.receive.paymentHash === paymentHash) {
|
if (this.receive.paymentHash === paymentHash) {
|
||||||
this.receive.show = false
|
this.receive.show = false
|
||||||
this.receive.paymentHash = null
|
this.receive.paymentHash = null
|
||||||
clearInterval(this.receive.paymentChecker)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createInvoice: function () {
|
createInvoice: function () {
|
||||||
@@ -419,19 +412,7 @@ new Vue({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clearInterval(this.receive.paymentChecker)
|
this.fetchPayments()
|
||||||
setTimeout(() => {
|
|
||||||
clearInterval(this.receive.paymentChecker)
|
|
||||||
}, 40000)
|
|
||||||
this.receive.paymentChecker = setInterval(() => {
|
|
||||||
let hash = response.data.payment_hash
|
|
||||||
|
|
||||||
LNbits.api.getPayment(this.g.wallet, hash).then(response => {
|
|
||||||
if (response.data.paid) {
|
|
||||||
this.onPaymentReceived(hash)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, 5000)
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
LNbits.utils.notifyApiError(err)
|
LNbits.utils.notifyApiError(err)
|
||||||
|
@@ -428,7 +428,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-dialog v-model="receive.show" @hide="closeReceiveDialog">
|
<q-dialog v-model="receive.show">
|
||||||
{% raw %}
|
{% raw %}
|
||||||
<q-card
|
<q-card
|
||||||
v-if="!receive.paymentReq"
|
v-if="!receive.paymentReq"
|
||||||
|
Reference in New Issue
Block a user