tweak
This commit is contained in:
@@ -120,6 +120,9 @@ window.PageWallet = {
|
|||||||
0
|
0
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
selectedTotalBreakdownSat() {
|
||||||
|
return Math.round(this.selectedTotalBreakdownMsat / 1000)
|
||||||
|
},
|
||||||
selectedTotalBreakdownCount() {
|
selectedTotalBreakdownCount() {
|
||||||
return this.selectedTotalBreakdownRows.reduce(
|
return this.selectedTotalBreakdownRows.reduce(
|
||||||
(total, row) => total + row.payments_count,
|
(total, row) => total + row.payments_count,
|
||||||
@@ -128,15 +131,28 @@ window.PageWallet = {
|
|||||||
},
|
},
|
||||||
formattedTotalBreakdown() {
|
formattedTotalBreakdown() {
|
||||||
return this.utils.formatBalance(
|
return this.utils.formatBalance(
|
||||||
this.selectedTotalBreakdownMsat / 1000,
|
this.selectedTotalBreakdownSat,
|
||||||
this.g.denomination
|
this.g.denomination
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
formattedTotalBreakdownFiat() {
|
formattedTotalBreakdownFiat() {
|
||||||
if (!this.g.fiatTracking) return null
|
if (!this.g.fiatTracking) return null
|
||||||
const sats = this.selectedTotalBreakdownMsat / 1000
|
const amount =
|
||||||
const amount = (sats / 100000000) * this.g.exchangeRate
|
(this.selectedTotalBreakdownSat / 100000000) * this.g.exchangeRate
|
||||||
return LNbits.utils.formatCurrency(amount, this.g.wallet.currency)
|
return LNbits.utils.formatCurrency(amount, this.g.wallet.currency)
|
||||||
|
},
|
||||||
|
primaryTotalBreakdownValue() {
|
||||||
|
if (this.g.isFiatPriority && this.g.fiatTracking) {
|
||||||
|
return this.formattedTotalBreakdownFiat || this.formattedTotalBreakdown
|
||||||
|
}
|
||||||
|
return this.formattedTotalBreakdown
|
||||||
|
},
|
||||||
|
secondaryTotalBreakdownValue() {
|
||||||
|
if (!this.g.fiatTracking) return null
|
||||||
|
if (this.g.isFiatPriority) {
|
||||||
|
return this.formattedTotalBreakdown
|
||||||
|
}
|
||||||
|
return this.formattedTotalBreakdownFiat
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -180,7 +196,10 @@ window.PageWallet = {
|
|||||||
.reduce((total, row) => total + row.total, 0)
|
.reduce((total, row) => total + row.total, 0)
|
||||||
},
|
},
|
||||||
formatTotalBreakdownMsat(msat) {
|
formatTotalBreakdownMsat(msat) {
|
||||||
return this.utils.formatBalance(msat / 1000, this.g.denomination)
|
return this.utils.formatBalance(
|
||||||
|
Math.round(msat / 1000),
|
||||||
|
this.g.denomination
|
||||||
|
)
|
||||||
},
|
},
|
||||||
handleSendLnurl(lnurl) {
|
handleSendLnurl(lnurl) {
|
||||||
this.parse.data.request = lnurl
|
this.parse.data.request = lnurl
|
||||||
|
|||||||
@@ -247,13 +247,13 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div
|
<div
|
||||||
class="text-h4 text-bold"
|
class="text-h4 text-bold"
|
||||||
v-text="formattedTotalBreakdown"
|
v-text="primaryTotalBreakdownValue"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
v-if="formattedTotalBreakdownFiat"
|
v-if="secondaryTotalBreakdownValue"
|
||||||
class="text-h6 text-italic"
|
class="text-h6 text-italic"
|
||||||
style="opacity: 0.75"
|
style="opacity: 0.75"
|
||||||
v-text="formattedTotalBreakdownFiat"
|
v-text="secondaryTotalBreakdownValue"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="text-caption text-grey-5"
|
class="text-caption text-grey-5"
|
||||||
@@ -290,6 +290,7 @@
|
|||||||
|
|
||||||
<q-separator v-if="hasFiatTotalBreakdown" class="q-mb-md"></q-separator>
|
<q-separator v-if="hasFiatTotalBreakdown" class="q-mb-md"></q-separator>
|
||||||
|
|
||||||
|
<div style="max-height: min(52vh, 420px); overflow-y: auto">
|
||||||
<q-list dense>
|
<q-list dense>
|
||||||
<q-item
|
<q-item
|
||||||
v-for="tag in totalBreakdownTags"
|
v-for="tag in totalBreakdownTags"
|
||||||
@@ -325,6 +326,7 @@
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="!totalBreakdown.loading && !totalBreakdown.rows.length">
|
<div v-if="!totalBreakdown.loading && !totalBreakdown.rows.length">
|
||||||
<q-banner class="bg-transparent text-grey-5">
|
<q-banner class="bg-transparent text-grey-5">
|
||||||
|
|||||||
Reference in New Issue
Block a user