fix: payment list updates (#2493)

* fix: payment list updates

---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡
2024-05-14 13:06:44 +02:00
committed by GitHub
co-authored by Vlad Stan
parent ab3fe79a7e
commit 8ee2948f71
4 changed files with 40 additions and 16 deletions
+14 -4
View File
@@ -1,6 +1,6 @@
Vue.component('payment-list', {
name: 'payment-list',
props: ['wallet', 'mobileSimple', 'lazy'],
props: ['update', 'wallet', 'mobileSimple', 'lazy'],
data: function () {
return {
denomination: LNBITS_DENOMINATION,
@@ -163,12 +163,22 @@ Vue.component('payment-list', {
this.wallet.name + '-payments'
)
})
},
formatCurrency: function (currency, amount) {
try {
return LNbits.utils.formatCurrency(currency, amount)
} catch (error) {
console.warn(error)
return `${amount} ???`
}
}
},
watch: {
lazy: function (newVal) {
debugger
if (newVal === true) this.fetchPayments()
},
update: function () {
this.fetchPayments()
}
},
created: function () {
@@ -294,13 +304,13 @@ Vue.component('payment-list', {
<br />
<i v-if="props.row.extra.wallet_fiat_currency">
<span
v-text="LNbits.utils.formatCurrency(props.row.extra.wallet_fiat_currency, props.row.extra.wallet_fiat_amount)"
v-text="formatCurrency(props.row.extra.wallet_fiat_currency, props.row.extra.wallet_fiat_amount)"
></span>
<br />
</i>
<i v-if="props.row.extra.fiat_currency">
<span
v-text="LNbits.utils.formatCurrency(props.row.extra.fiat_currency, props.row.extra.fiat_amount)"
v-text="formatCurrency(props.row.extra.fiat_currency, props.row.extra.fiat_amount)"
></span>
</i>
</q-td>