mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-23 15:22:13 +02:00
feat: show balance
This commit is contained in:
parent
ac773cffda
commit
429f14e728
@ -22,7 +22,7 @@ page_container %}
|
|||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h3 class="q-my-none">
|
<h3 class="q-my-none">
|
||||||
<center>
|
<center>
|
||||||
<strong>{% raw %} {{balanceAmount}} </strong>
|
<strong>{% raw %} {{balance}} </strong>
|
||||||
{{tickershort}}{% endraw %}
|
{{tickershort}}{% endraw %}
|
||||||
</center>
|
</center>
|
||||||
</h3>
|
</h3>
|
||||||
@ -357,7 +357,6 @@ page_container %}
|
|||||||
mixins: [windowMixin],
|
mixins: [windowMixin],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
balanceAmount: '',
|
|
||||||
tickershort: '',
|
tickershort: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
|
||||||
@ -497,7 +496,7 @@ page_container %}
|
|||||||
show: false,
|
show: false,
|
||||||
location: window.location
|
location: window.location
|
||||||
},
|
},
|
||||||
balance: 0,
|
|
||||||
credit: 0,
|
credit: 0,
|
||||||
newName: ''
|
newName: ''
|
||||||
}
|
}
|
||||||
@ -516,8 +515,8 @@ page_container %}
|
|||||||
},
|
},
|
||||||
|
|
||||||
tokenList: function () {
|
tokenList: function () {
|
||||||
const y = {}
|
const x = this.tokens
|
||||||
let x = this.tokens
|
.filter(t => t.promises?.length)
|
||||||
.map(t => t.blindedMessages)
|
.map(t => t.blindedMessages)
|
||||||
.flat()
|
.flat()
|
||||||
.map(t => ({
|
.map(t => ({
|
||||||
@ -535,6 +534,14 @@ page_container %}
|
|||||||
count: x[k].length,
|
count: x[k].length,
|
||||||
value: x[k][0].denomination * x[k].length
|
value: x[k][0].denomination * x[k].length
|
||||||
}))
|
}))
|
||||||
|
},
|
||||||
|
|
||||||
|
balance: function () {
|
||||||
|
return this.tokens
|
||||||
|
.filter(t => t.promises?.length)
|
||||||
|
.map(t => t.blindedMessages)
|
||||||
|
.flat()
|
||||||
|
.reduce((sum, el) => (sum += el.amount), 0)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@ -584,9 +591,7 @@ page_container %}
|
|||||||
this.parse.data.paymentChecker = null
|
this.parse.data.paymentChecker = null
|
||||||
this.parse.camera.show = false
|
this.parse.camera.show = false
|
||||||
},
|
},
|
||||||
updateBalance: function (credit) {
|
|
||||||
this.balance = this.balance // update balance
|
|
||||||
},
|
|
||||||
closeReceiveDialog: function () {
|
closeReceiveDialog: function () {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
clearInterval(this.receive.paymentChecker)
|
clearInterval(this.receive.paymentChecker)
|
||||||
@ -1043,10 +1048,6 @@ page_container %}
|
|||||||
this.tickershort = this.$q.localStorage.getItem('cashu.tickershort')
|
this.tickershort = this.$q.localStorage.getItem('cashu.tickershort')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.$q.localStorage.getItem('cashu.amount')) {
|
|
||||||
this.balanceAmount = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// get mint
|
// get mint
|
||||||
if (params.get('mint_id')) {
|
if (params.get('mint_id')) {
|
||||||
this.mintId = params.get('mint_id')
|
this.mintId = params.get('mint_id')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user