fix: stop the links polling insanity (#72)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled

WTF was this for anyway?!
This commit is contained in:
Tiago Vasconcelos 2024-11-25 10:07:26 +00:00 committed by GitHub
commit e00a81bfbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,6 @@ window.app = Vue.createApp({
domain: window.location.host, domain: window.location.host,
currencies: [], currencies: [],
fiatRates: {}, fiatRates: {},
checker: null,
payLinks: [], payLinks: [],
payLinksTable: { payLinksTable: {
pagination: { pagination: {
@ -70,7 +69,6 @@ window.app = Vue.createApp({
this.payLinks = response.data.map(mapPayLink) this.payLinks = response.data.map(mapPayLink)
}) })
.catch(err => { .catch(err => {
clearInterval(this.checker)
LNbits.utils.notifyApiError(err) LNbits.utils.notifyApiError(err)
}) })
}, },
@ -178,7 +176,7 @@ window.app = Vue.createApp({
'/lnurlp/api/v1/links/' + linkId, '/lnurlp/api/v1/links/' + linkId,
_.findWhere(this.g.user.wallets, {id: link.wallet}).adminkey _.findWhere(this.g.user.wallets, {id: link.wallet}).adminkey
) )
.then(response => { .then(() => {
this.payLinks = _.reject(this.payLinks, obj => obj.id === linkId) this.payLinks = _.reject(this.payLinks, obj => obj.id === linkId)
}) })
.catch(err => { .catch(err => {
@ -237,11 +235,7 @@ window.app = Vue.createApp({
}, },
created() { created() {
if (this.g.user.wallets?.length) { if (this.g.user.wallets?.length) {
var getPayLinks = this.getPayLinks this.getPayLinks()
getPayLinks()
this.checker = setInterval(() => {
getPayLinks()
}, 20000)
} }
LNbits.api LNbits.api
.request('GET', '/lnurlp/api/v1/currencies') .request('GET', '/lnurlp/api/v1/currencies')