diff --git a/static/components/receipt.js b/static/components/receipt.js index 77ac2fb..0bdc829 100644 --- a/static/components/receipt.js +++ b/static/components/receipt.js @@ -68,7 +68,7 @@ window.app.component('receipt', { } }, created() { - this.currency = this.data.extra.details.currency || LNBITS_DENOMINATION + this.currency = this.data.extra.details.currency || g.settings.denomination this.exchangeRate = this.data.extra.details.exchangeRate || 1 console.log('Receipt component created', this.data) }, diff --git a/static/js/index.js b/static/js/index.js index c97c5b0..951886b 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -648,8 +648,8 @@ window.app = Vue.createApp({ .request('GET', '/api/v1/currencies') .then(response => { this.currencyOptions = ['sats', ...response.data] - if (LNBITS_DENOMINATION != 'sats') { - this.formDialog.data.currency = DENOMINATION + if (g.settings.denomination != 'sats') { + this.formDialog.data.currency = g.settings.denomination } }) .catch(LNbits.utils.notifyApiError) diff --git a/static/js/tpos.js b/static/js/tpos.js index 690df43..582ccb5 100644 --- a/static/js/tpos.js +++ b/static/js/tpos.js @@ -770,7 +770,7 @@ window.app = Vue.createApp({ pay_in_fiat: this.payInFiat, fiat_method: this.fiatMethod } - if (this.currency != LNBITS_DENOMINATION) { + if (this.currency != g.settings.denomination) { params.amount_fiat = this.total > 0 ? this.total : this.amount params.tip_amount_fiat = this.tipAmount > 0 ? this.tipAmount : 0.0 } @@ -1057,7 +1057,7 @@ window.app = Vue.createApp({ async getRates() { let rate = 1 try { - if (this.currency != LNBITS_DENOMINATION) { + if (this.currency != g.settings.denomination) { const {data} = await LNbits.api.request( 'GET', `/api/v1/rate/${this.currency}` @@ -1080,7 +1080,7 @@ window.app = Vue.createApp({ let last = [...res.data] this.lastPaymentsDialog.data = last.map(obj => { obj.dateFrom = moment(obj.time).fromNow() - if (obj.currency != LNBITS_DENOMINATION) { + if (obj.currency != g.settings.denomination) { obj.amountFiat = this.formatAmount( obj.amount / 1000 / (obj.exchange_rate || this.exchangeRate), this.currency @@ -1147,8 +1147,11 @@ window.app = Vue.createApp({ } }, formatAmount(amount, currency) { - if (LNBITS_DENOMINATION != 'sats') { - return LNbits.utils.formatCurrency(amount / 100, LNBITS_DENOMINATION) + if (g.settings.denomination != 'sats') { + return LNbits.utils.formatCurrency( + amount / 100, + g.settings.denomination + ) } if (currency == 'sats') { return LNbits.utils.formatSat(amount) + ' sats' diff --git a/templates/tpos/index.html b/templates/tpos/index.html index faa99c8..ffef6a0 100644 --- a/templates/tpos/index.html +++ b/templates/tpos/index.html @@ -381,7 +381,7 @@