Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/components/receipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
4 changes: 2 additions & 2 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 8 additions & 5 deletions static/js/tpos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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}`
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand Down
11 changes: 4 additions & 7 deletions templates/tpos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ <h6 class="text-subtitle1 q-my-none">{{SITE_TITLE}} TPoS extension</h6>
label="Wallet *"
></q-select>
<q-select
v-if="'{{LNBITS_DENOMINATION}}' == 'sats'"
v-if="g.settings.denomination == 'sats'"
filled
dense
emit-value
Expand All @@ -390,7 +390,7 @@ <h6 class="text-subtitle1 q-my-none">{{SITE_TITLE}} TPoS extension</h6>
label="Currency *"
></q-select>
<q-select
v-if="formDialog.data.currency != '{{LNBITS_DENOMINATION}}' && hasFiatProvider"
v-if="formDialog.data.currency != g.settings.denomination && hasFiatProvider"
filled
dense
emit-value
Expand Down Expand Up @@ -562,7 +562,7 @@ <h6 class="text-subtitle1 q-my-none">{{SITE_TITLE}} TPoS extension</h6>
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}) *`"
></q-input>

<div class="row">
Expand All @@ -573,7 +573,7 @@ <h6 class="text-subtitle1 q-my-none">{{SITE_TITLE}} TPoS extension</h6>
v-model.number="formDialog.data.withdraw_between"
type="number"
min="0"
label="Time between withdraws"
:label="`Time between withdraws (${g.settings.denomination})`"
></q-input>
</div>
<div class="col-4">
Expand Down Expand Up @@ -826,8 +826,5 @@ <h6 class="text-subtitle1 q-my-none">
</q-dialog>
</div>
{% endblock %} {% block scripts %} {{ window_vars(user) }}
<script>
const DENOMINATION = '{{ LNBITS_DENOMINATION }}'
</script>
<script src="{{ static_url_for('tpos/static', path='js/index.js') }}"></script>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/tpos/tpos.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3 class="q-mb-md">
<span v-text="amountFormatted"></span>
</h3>
<h5
v-show="!denomIsSats && '{{LNBITS_DENOMINATION}}' == 'sats'"
v-show="!denomIsSats && g.settings.denomination == 'sats'"
Copy link
Member

@dni dni Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
v-show="!denomIsSats && g.settings.denomination == 'sats'"
v-show="false"

simplification.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use the v-show then?

The conditions work as expected. When we have a custom token (POOP), we don't want to show any sats convertion!

class="q-mt-none q-mb-sm"
>
<span v-text="fsat"> </span>
Expand Down