feat: add failed payments toggle to wallet page (#2794)

* feat: add failed payments toggle to wallet page

---------

Co-authored-by: Tiago Vasconcelos <talvasconcelos@gmail.com>
This commit is contained in:
dni ⚡
2024-12-10 11:47:09 +01:00
committed by GitHub
co-authored by Tiago Vasconcelos
parent 5104cbb285
commit 7ee78248b7
7 changed files with 54 additions and 23 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -378,6 +378,7 @@ window.LNbits = {
prepareFilterQuery(tableConfig, props) {
if (props) {
tableConfig.pagination = props.pagination
tableConfig.filter = props.filter
}
let pagination = tableConfig.pagination
tableConfig.loading = true
+14 -1
View File
@@ -6,6 +6,7 @@ window.app.component('payment-list', {
data: function () {
return {
denomination: LNBITS_DENOMINATION,
failedPaymentsToggle: false,
payments: [],
paymentsTable: {
columns: [
@@ -32,6 +33,9 @@ window.app.component('payment-list', {
rowsNumber: 10
},
search: null,
filter: {
'status[ne]': 'failed'
},
loading: false
},
exportTagName: '',
@@ -107,7 +111,6 @@ window.app.component('payment-list', {
field: row => row.extra.wallet_fiat_amount
}
],
filter: null,
loading: false
}
}
@@ -215,6 +218,16 @@ window.app.component('payment-list', {
}
},
watch: {
failedPaymentsToggle(newVal) {
if (newVal === false) {
this.paymentsTable.filter = {
'status[ne]': 'failed'
}
} else {
this.paymentsTable.filter = null
}
this.fetchPayments()
},
lazy: function (newVal) {
if (newVal === true) this.fetchPayments()
},