Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Aug 16, 2024
1 parent f4d8fb8 commit 1d4f5fb
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ new Vue({
},
data: function () {
return {
currencies: [],
fiatRates: {},
settings: {},
settings: [
{
Expand Down Expand Up @@ -134,7 +136,8 @@ new Vue({
description: '',
custom_css: '',
time: null,
amount: null
amount: null,
currency: 'satoshis',
}
},
formDialogThemes: {
Expand Down Expand Up @@ -376,7 +379,19 @@ new Vue({
this.chargeLinks,
'charges'
)
}
},
updateFiatRate(currency) {
LNbits.api
.request('GET', '/lnurlp/api/v1/rate/' + currency, null)
.then(response => {
let rates = _.clone(this.fiatRates)
rates[currency] = response.data.rate
this.fiatRates = rates
})
.catch(err => {
LNbits.utils.notifyApiError(err)
})
},
},
created: async function () {
if (this.admin == 'True') {
Expand All @@ -385,5 +400,13 @@ new Vue({
await this.getCharges()
await this.getWalletConfig()
await this.getWalletLinks()
LNbits.api
.request('GET', '/api/v1/currencies')
.then(response => {
this.currencies = ['satoshis', ...response.data]
})
.catch(err => {
LNbits.utils.notifyApiError(err)
})
}
})

0 comments on commit 1d4f5fb

Please sign in to comment.