Fake wallet fixes (#2983)

* Fake wallet fixes

LNBITS_DENOMINATION and LNBITS_DENOMINATION == 'sats' everywhere!

* added exception to "/api/v1/rate/{currency}"

* fix: create invoice dialog

* cleaning expansion items in wallet

* Revert "fix: create invoice dialog"

This reverts commit 2b550392ba080cad708519fede897891e5b9e686.

* fix fakewallet mask break

* Fix formatted amount for fakewallet

* fixed wallet balance for fakewallet

* Wow, actually cleaning code, win!

* more cleaning

* For Vlad

* more cleaning

* make

* fix for sats

* bundle issue

* fix overflow in drawer for fat wallets and stupid long names

* make

* fixed adds

* fixed ad scale

* fundle

* fix

---------

Co-authored-by: Tiago Vasconcelos <talvasconcelos@gmail.com>
This commit is contained in:
Arc
2025-02-23 00:23:36 +00:00
committed by GitHub
co-authored by Tiago Vasconcelos
parent b06c16ed57
commit eeca7de10d
7 changed files with 88 additions and 97 deletions
+9 -4
View File
@@ -128,7 +128,10 @@ window.WalletPageLogic = {
computed: {
formattedBalance() {
if (LNBITS_DENOMINATION != 'sats') {
return this.g.wallet.sat / 100
return LNbits.utils.formatCurrency(
this.g.wallet.sat / 100,
LNBITS_DENOMINATION
)
} else {
return LNbits.utils.formatSat(this.g.wallet.sat)
}
@@ -138,10 +141,12 @@ window.WalletPageLogic = {
return this.parse.invoice.sat <= this.g.wallet.sat
},
formattedAmount() {
if (this.receive.unit != 'sat') {
if (this.receive.unit != 'sat' || LNBITS_DENOMINATION != 'sats') {
return LNbits.utils.formatCurrency(
Number(this.receive.data.amount).toFixed(2),
this.receive.unit
LNBITS_DENOMINATION != 'sats'
? LNBITS_DENOMINATION
: this.receive.unit
)
} else {
return LNbits.utils.formatMsat(this.receive.amountMsat) + ' sat'
@@ -831,7 +836,7 @@ window.WalletPageLogic = {
createdTasks() {
this.update.name = this.g.wallet.name
this.receive.units = ['sat', ...(window.currencies || [])]
if (this.g.wallet.currency != '') {
if (this.g.wallet.currency != '' && LNBITS_DENOMINATION == 'sats') {
this.g.fiatTracking = true
this.updateFiatBalance(this.g.wallet.currency)
} else {