[fix]: small fixes v1 on demo DB (#2940)

This commit is contained in:
Vlad Stan 2025-02-10 10:25:33 +02:00 committed by GitHub
parent 90dd3cc73a
commit 828261d696
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -312,7 +312,7 @@ window.LNbits = {
formatCurrency(value, currency) { formatCurrency(value, currency) {
return new Intl.NumberFormat(window.LOCALE, { return new Intl.NumberFormat(window.LOCALE, {
style: 'currency', style: 'currency',
currency: currency currency: currency || 'sat'
}).format(value) }).format(value)
}, },
formatSat(value) { formatSat(value) {

View file

@ -650,10 +650,10 @@ window.WalletPageLogic = {
(this.g.exchangeRate / 100000000) * this.g.wallet.sat (this.g.exchangeRate / 100000000) * this.g.wallet.sat
this.formatFiatAmount(this.g.fiatBalance, currency) this.formatFiatAmount(this.g.fiatBalance, currency)
} }
LNbits.api if (currency && this.g.wallet.currency == currency) {
.request('GET', `/api/v1/rate/` + currency, null) LNbits.api
.then(response => { .request('GET', `/api/v1/rate/` + currency, null)
if (this.g.wallet.currency == currency) { .then(response => {
this.g.fiatBalance = this.g.fiatBalance =
(response.data.price / 100000000) * this.g.wallet.sat (response.data.price / 100000000) * this.g.wallet.sat
this.g.exchangeRate = response.data.price.toFixed(2) this.g.exchangeRate = response.data.price.toFixed(2)
@ -663,9 +663,9 @@ window.WalletPageLogic = {
'lnbits.exchangeRate.' + currency, 'lnbits.exchangeRate.' + currency,
this.g.exchangeRate this.g.exchangeRate
) )
} })
}) .catch(e => console.error(e))
.catch(e => console.error(e)) }
}, },
pasteToTextArea() { pasteToTextArea() {
this.$refs.textArea.focus() this.$refs.textArea.focus()