fix: wallet balance format (#2985)

This commit is contained in:
Arc 2025-02-23 01:09:28 +00:00 committed by GitHub
parent 4511891297
commit 2af5ac9678
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View file

@ -61,7 +61,7 @@
<div class="col-auto">
<div class="text-h3 q-my-none text-no-wrap">
<strong
v-text="formatBalance(this.g.wallet.sat)"
v-text="walletFormatBalance(this.g.wallet.sat)"
></strong>
</div>
</div>
@ -704,7 +704,7 @@
<div class="column content-center text-center q-mb-md">
<div v-if="!isFiatPriority">
<h4 class="q-my-none text-bold">
<span v-text="formatBalance(parse.invoice.sat)"></span>
<span v-text="walletFormatBalance(parse.invoice.sat)"></span>
</h4>
</div>
<div v-else>
@ -734,7 +734,9 @@
</div>
<div v-else style="opacity: 0.75">
<h5 class="q-my-none text-bold">
<span v-text="formatBalance(parse.invoice.sat)"></span>
<span
v-text="walletFormatBalance(parse.invoice.sat)"
></span>
</h5>
</div>
</div>

View file

@ -844,6 +844,13 @@ window.WalletPageLogic = {
this.g.fiatTracking = false
}
},
walletFormatBalance(amount) {
if (LNBITS_DENOMINATION != 'sats') {
return LNbits.utils.formatCurrency(amount / 100, LNBITS_DENOMINATION)
} else {
return LNbits.utils.formatSat(amount) + ' sats'
}
},
handleFilterChange(value = {}) {
if (
this.paymentsFilter['time[ge]'] !== value['time[ge]'] ||