fix: g.wallet artifacts in lnbits-payment-list and lnbits-manage-wall... (#3601)

This commit is contained in:
dni ⚡ 2025-12-01 09:10:40 +01:00 committed by GitHub
parent 6449276003
commit ad8b70a098
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 20 deletions

File diff suppressed because one or more lines are too long

View file

@ -3,7 +3,16 @@ window.app.component('lnbits-manage-wallet-list', {
mixins: [window.windowMixin],
data() {
return {
walletName: ''
activeWalletId: null
}
},
watch: {
$route(to) {
if (to.path.startsWith('/wallet/')) {
this.activeWalletId = to.params.id
} else {
this.activeWalletId = null
}
}
}
})

View file

@ -259,7 +259,7 @@ window.app.component('lnbits-payment-list', {
},
checkPayment(payment_hash) {
LNbits.api
.getPayment(this.g.wallet, payment_hash)
.getPayment(this.wallet, payment_hash)
.then(res => {
this.update = !this.update
if (res.data.status == 'success') {
@ -319,7 +319,7 @@ window.app.component('lnbits-payment-list', {
},
cancelHoldInvoice(payment_hash) {
LNbits.api
.cancelInvoice(this.g.wallet, payment_hash)
.cancelInvoice(this.wallet, payment_hash)
.then(() => {
this.update = !this.update
Quasar.Notify.create({
@ -331,7 +331,7 @@ window.app.component('lnbits-payment-list', {
},
settleHoldInvoice(preimage) {
LNbits.api
.settleInvoice(this.g.wallet, preimage)
.settleInvoice(this.wallet, preimage)
.then(() => {
this.update = !this.update
Quasar.Notify.create({
@ -354,7 +354,7 @@ window.app.component('lnbits-payment-list', {
direction: pagination.descending ? 'desc' : 'asc'
}
const params = new URLSearchParams(query)
LNbits.api.getPayments(this.g.wallet, params).then(response => {
LNbits.api.getPayments(this.wallet, params).then(response => {
let payments = response.data.data.map(this.mapPayment)
let columns = this.paymentsCSV.columns
@ -382,7 +382,7 @@ window.app.component('lnbits-payment-list', {
LNbits.utils.exportCSV(
columns,
payments,
this.g.wallet.name + '-payments'
this.wallet.name + '-payments'
)
})
},
@ -451,7 +451,7 @@ window.app.component('lnbits-payment-list', {
await LNbits.api.request(
'PUT',
`/api/v1/payments/${this.selectedPayment.payment_hash}/labels`,
this.g.wallet.adminkey,
this.wallet.adminkey,
{
labels: labels
}

View file

@ -11,24 +11,16 @@
)"
:key="walletRec.id"
clickable
:active="g.wallet && g.wallet.id === walletRec.id"
:active="walletRec.id === activeWalletId"
@click="$router.push('/wallet/' + walletRec.id)"
>
<q-item-section side>
<q-avatar
size="lg"
:text-color="$q.dark.isActive ? 'black' : 'grey-3'"
:class="g.wallet && g.wallet.id === walletRec.id ? '' : 'disabled'"
:color="
g.wallet && g.wallet.id === walletRec.id
? walletRec.extra.color
: walletRec.extra.color
"
:icon="
g.wallet && g.wallet.id === walletRec.id
? walletRec.extra.icon
: walletRec.extra.icon
"
:disabled="walletRec.id === activeWalletId"
:color="walletRec.extra.color"
:icon="walletRec.extra.icon"
>
</q-avatar>
</q-item-section>