diff --git a/lnbits/extensions/cashu/templates/cashu/wallet.html b/lnbits/extensions/cashu/templates/cashu/wallet.html
index efd3ded3..e771cf9c 100644
--- a/lnbits/extensions/cashu/templates/cashu/wallet.html
+++ b/lnbits/extensions/cashu/templates/cashu/wallet.html
@@ -22,7 +22,7 @@ page_container %}
- {% raw %} {{balance}}
+ {% raw %} {{getBalance()}}
{{tickershort}}{% endraw %}
@@ -81,7 +81,7 @@ page_container %}
t)
+ .flat()
+ .reduce((sum, el) => (sum += el.amount), 0)
+ },
+ getTokenList: function () {
+ const x = this.proofs
+ .map(t => t.amount)
+ .reduce((acc, amount) => {
+ acc[amount] = acc[amount] + amount || 1
+ return acc
+ }, {})
+ return Object.keys(x).map(k => ({
+ value: k,
+ count: x[k],
+ sum: k * x[k]
+ }))
+ },
+
paymentTableRowKey: function (row) {
return row.payment_hash + row.amount
},
@@ -1269,7 +1289,7 @@ page_container %}
if (!proofs.length) {
throw 'could not mint'
}
- this.proofs.push(...proofs)
+ this.proofs = this.proofs.concat(proofs)
this.storeProofs()
await this.setInvoicePaid(payment_hash)
return proofs
@@ -1398,8 +1418,7 @@ page_container %}
const usedSecrets = proofs.map(p => p.secret)
this.proofs = this.proofs.filter(p => !usedSecrets.includes(p.secret))
// add new fristProofs, scndProofs to this.proofs
- this.proofs.push(...fristProofs)
- this.proofs.push(...scndProofs)
+ this.proofs = this.proofs.concat(fristProofs).concat(scndProofs)
this.storeProofs()
return {fristProofs, scndProofs}
} catch (error) {