[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) {
return new Intl.NumberFormat(window.LOCALE, {
style: 'currency',
currency: currency
currency: currency || 'sat'
}).format(value)
},
formatSat(value) {

View file

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