From bf1715c3302912bd6e3021eb3df93ec8e3da6db9 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Fri, 30 Jan 2026 17:47:39 +0000 Subject: [PATCH 1/2] replace variables for global var --- static/components/receipt.js | 2 +- static/js/index.js | 4 ++-- static/js/tpos.js | 13 ++++++++----- templates/tpos/index.html | 11 ++++------- templates/tpos/tpos.html | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) 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..cfc5161 100644 --- a/templates/tpos/index.html +++ b/templates/tpos/index.html @@ -381,7 +381,7 @@
{{SITE_TITLE}} TPoS extension
label="Wallet *" > {{SITE_TITLE}} TPoS extension label="Currency *" > {{SITE_TITLE}} TPoS extension dense v-model.number="formDialog.data.withdraw_limit" type="number" - label="Max amount to be sold daily ({{LNBITS_DENOMINATION}}) *" + label="Max amount to be sold daily ({{g.settings.denomination}}) *" >
@@ -573,7 +573,7 @@
{{SITE_TITLE}} TPoS extension
v-model.number="formDialog.data.withdraw_between" type="number" min="0" - label="Time between withdraws" + label="Time between withdraws ({{g.settings.denomination}})" >
@@ -826,8 +826,5 @@
{% endblock %} {% block scripts %} {{ window_vars(user) }} - {% endblock %} diff --git a/templates/tpos/tpos.html b/templates/tpos/tpos.html index 1d99e7a..06c1046 100644 --- a/templates/tpos/tpos.html +++ b/templates/tpos/tpos.html @@ -28,7 +28,7 @@

From 37d55aa2b8a55f351a575ba2320d94653d52556a Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Fri, 30 Jan 2026 17:54:35 +0000 Subject: [PATCH 2/2] oops --- templates/tpos/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/tpos/index.html b/templates/tpos/index.html index cfc5161..ffef6a0 100644 --- a/templates/tpos/index.html +++ b/templates/tpos/index.html @@ -562,7 +562,7 @@
{{SITE_TITLE}} TPoS extension
dense v-model.number="formDialog.data.withdraw_limit" type="number" - label="Max amount to be sold daily ({{g.settings.denomination}}) *" + :label="`Max amount to be sold daily (${g.settings.denomination}) *`" >
@@ -573,7 +573,7 @@
{{SITE_TITLE}} TPoS extension
v-model.number="formDialog.data.withdraw_between" type="number" min="0" - label="Time between withdraws ({{g.settings.denomination}})" + :label="`Time between withdraws (${g.settings.denomination})`" >