fix: multiple ws connections (#2907)
This commit is contained in:
parent
273ab9781f
commit
56a4b702f3
2 changed files with 8 additions and 6 deletions
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -450,15 +450,16 @@ if (!window.g) {
|
||||||
wallets: [],
|
wallets: [],
|
||||||
payments: [],
|
payments: [],
|
||||||
allowedThemes: null,
|
allowedThemes: null,
|
||||||
langs: []
|
langs: [],
|
||||||
|
walletEventListeners: []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
window.windowMixin = {
|
window.windowMixin = {
|
||||||
inject: ['g'],
|
|
||||||
i18n: window.i18n,
|
i18n: window.i18n,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
g: window.g,
|
||||||
toggleSubs: true,
|
toggleSubs: true,
|
||||||
updatePayments: false,
|
updatePayments: false,
|
||||||
updatePaymentsHash: '',
|
updatePaymentsHash: '',
|
||||||
|
|
@ -469,7 +470,7 @@ window.windowMixin = {
|
||||||
gradientChoice:
|
gradientChoice:
|
||||||
this.$q.localStorage.getItem('lnbits.gradientBg') || false,
|
this.$q.localStorage.getItem('lnbits.gradientBg') || false,
|
||||||
isUserAuthorized: false,
|
isUserAuthorized: false,
|
||||||
eventListeners: [],
|
walletEventListeners: [],
|
||||||
backgroundImage: ''
|
backgroundImage: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -487,9 +488,10 @@ window.windowMixin = {
|
||||||
this.refreshRoute()
|
this.refreshRoute()
|
||||||
},
|
},
|
||||||
paymentEvents() {
|
paymentEvents() {
|
||||||
|
this.g.walletEventListeners = this.g.walletEventListeners || []
|
||||||
this.g.user.wallets.forEach(wallet => {
|
this.g.user.wallets.forEach(wallet => {
|
||||||
if (!this.eventListeners.includes(wallet.id)) {
|
if (!this.g.walletEventListeners.includes(wallet.id)) {
|
||||||
this.eventListeners.push(wallet.id)
|
this.g.walletEventListeners.push(wallet.id)
|
||||||
LNbits.events.onInvoicePaid(wallet, data => {
|
LNbits.events.onInvoicePaid(wallet, data => {
|
||||||
const walletIndex = this.g.user.wallets.findIndex(
|
const walletIndex = this.g.user.wallets.findIndex(
|
||||||
w => w.id === wallet.id
|
w => w.id === wallet.id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue