fixes wallet ws (#2912)

This commit is contained in:
Arc 2025-01-28 12:14:12 +00:00 committed by GitHub
parent 25e5423511
commit 66b2ca2ac4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 14 deletions

File diff suppressed because one or more lines are too long

View file

@ -451,7 +451,9 @@ if (!window.g) {
payments: [],
allowedThemes: null,
langs: [],
walletEventListeners: []
walletEventListeners: [],
updatePayments: false,
updatePaymentsHash: ''
})
}
@ -461,8 +463,6 @@ window.windowMixin = {
return {
g: window.g,
toggleSubs: true,
updatePayments: false,
updatePaymentsHash: '',
mobileSimple: true,
walletFlip: true,
borderSelection: null,
@ -528,7 +528,7 @@ window.windowMixin = {
//update the current wallet
if (this.g.wallet.id === data.payment.wallet_id) {
Object.assign(this.g.wallet, this.g.user.wallets[walletIndex])
this.updatePayments = !this.updatePayments
//if on the wallet page and payment is incoming trigger the eventReaction
if (
data.payment.amount > 0 &&
@ -538,14 +538,16 @@ window.windowMixin = {
}
}
}
this.updatePaymentsHash = data.payment.payment_hash
this.g.updatePaymentsHash = data.payment.payment_hash
this.g.updatePayments = !this.g.updatePayments
})
}
})
},
selectWallet(wallet) {
Object.assign(this.g.wallet, wallet)
this.updatePayments = !this.updatePayments
// this.wallet = this.g.wallet
this.g.updatePayments = !this.g.updatePayments
this.balance = parseInt(wallet.balance_msat / 1000)
const currentPath = this.$route.path
if (currentPath !== '/wallet') {
@ -663,9 +665,9 @@ window.windowMixin = {
}
let style = document.createElement('style')
style.innerHTML = `
body[data-theme="${this.themeChoice}"] .q-card,
body[data-theme="${this.themeChoice}"] .q-card.q-card--dark,
body[data-theme="${this.themeChoice}"] .q-date,
body[data-theme="${this.themeChoice}"] .q-card,
body[data-theme="${this.themeChoice}"] .q-card.q-card--dark,
body[data-theme="${this.themeChoice}"] .q-date,
body[data-theme="${this.themeChoice}"] .q-date--dark {
${borderStyleCSS}
}

View file

@ -201,7 +201,7 @@ window.WalletPageLogic = {
'hiddenQrCodeContainer'
).innerHTML
})
this.updatePayments = !this.updatePayments
this.g.updatePayments = !this.g.updatePayments
})
.catch(err => {
LNbits.utils.notifyApiError(err)
@ -381,7 +381,7 @@ window.WalletPageLogic = {
.catch(err => {
dismissPaymentMsg()
LNbits.utils.notifyApiError(err)
this.updatePayments = !this.updatePayments
this.g.updatePayments = !this.g.updatePayments
this.parse.show = false
})
},
@ -713,9 +713,10 @@ window.WalletPageLogic = {
this.createdTasks()
},
watch: {
updatePayments() {
'g.updatePayments'(newVal, oldVal) {
console.log('updatePayments changed:', {newVal, oldVal})
this.parse.show = false
if (this.receive.paymentHash === this.updatePaymentsHash) {
if (this.receive.paymentHash === this.g.updatePaymentsHash) {
this.receive.show = false
this.receive.paymentHash = null
}