chore: cleanup LNBITS_DENOMINATION global var (#3580)

This commit is contained in:
dni ⚡ 2025-11-26 15:15:20 +01:00 committed by GitHub
parent da31e3caaa
commit c6c67c52db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 18 additions and 32 deletions

File diff suppressed because one or more lines are too long

View file

@ -58,11 +58,6 @@ window.app.component('lnbits-payment-details', {
template: '#lnbits-payment-details',
props: ['payment'],
mixins: [window.windowMixin],
data() {
return {
LNBITS_DENOMINATION: LNBITS_DENOMINATION
}
},
computed: {
hasPreimage() {
return (
@ -364,9 +359,6 @@ window.app.component('lnbits-update-balance', {
mixins: [window.windowMixin],
props: ['wallet_id', 'small_btn'],
computed: {
denomination() {
return LNBITS_DENOMINATION
},
admin() {
return user.super_user
}

View file

@ -2,9 +2,6 @@ window.app.component('lnbits-header', {
template: '#lnbits-header',
mixins: [window.windowMixin],
computed: {
denomination() {
return this.LNBITS_DENOMINATION || 'sat'
},
hasServiceFeeMax() {
return (
this.g.user &&

View file

@ -95,7 +95,7 @@ window.app.component('lnbits-home-logos', {
computed: {
showLogos() {
return (
this.LNBITS_DENOMINATION == 'sats' &&
this.g.isSatsDenomination &&
this.SITE_TITLE == 'LNbits' &&
this.LNBITS_SHOW_HOME_PAGE_ELEMENTS == true
)

View file

@ -4,7 +4,6 @@ window.app.component('lnbits-payment-list', {
mixins: [window.windowMixin],
data() {
return {
denomination: LNBITS_DENOMINATION,
payments: [],
paymentsTable: {
columns: [
@ -18,7 +17,7 @@ window.app.component('lnbits-payment-list', {
{
name: 'amount',
align: 'right',
label: this.$t('amount') + ' (' + LNBITS_DENOMINATION + ')',
label: this.$t('amount'),
field: 'sat',
sortable: true
}
@ -67,14 +66,14 @@ window.app.component('lnbits-payment-list', {
{
name: 'amount',
align: 'right',
label: this.$t('amount') + ' (' + LNBITS_DENOMINATION + ')',
label: this.$t('amount'),
field: 'sat',
sortable: true
},
{
name: 'fee',
align: 'right',
label: this.$t('fee') + ' (m' + LNBITS_DENOMINATION + ')',
label: this.$t('fee'),
field: 'fee'
},
{

View file

@ -57,7 +57,7 @@ window.PageHome = {
},
lnbitsBannerEnabled() {
return (
this.LNBITS_DENOMINATION == 'sats' &&
this.isSatsDenomination &&
this.SITE_TITLE == 'LNbits' &&
this.LNBITS_SHOW_HOME_PAGE_ELEMENTS == true
)

View file

@ -91,14 +91,14 @@ window.PageNode = {
{
name: 'sat',
align: 'right',
label: this.$t('amount') + ' (' + LNBITS_DENOMINATION + ')',
label: this.$t('amount'),
field: row => this.formatMsat(row.amount),
sortable: true
},
{
name: 'fee',
align: 'right',
label: this.$t('fee') + ' (m' + LNBITS_DENOMINATION + ')',
label: this.$t('fee'),
field: 'fee'
},
{
@ -144,7 +144,7 @@ window.PageNode = {
},
{
name: 'amount',
label: this.$t('amount') + ' (' + LNBITS_DENOMINATION + ')',
label: this.$t('amount'),
field: row => this.formatMsat(row.amount),
sortable: true
},

View file

@ -75,12 +75,10 @@ window.PageWallet = {
return this.parse.invoice.sat <= this.g.wallet.sat
},
formattedAmount() {
if (this.receive.unit != 'sat' || LNBITS_DENOMINATION != 'sats') {
if (this.receive.unit != 'sat' || !this.g.isSatsDenomination) {
return LNbits.utils.formatCurrency(
Number(this.receive.data.amount).toFixed(2),
LNBITS_DENOMINATION != 'sats'
? LNBITS_DENOMINATION
: this.receive.unit
!this.g.isSatsDenomination ? this.g.denomination : this.receive.unit
)
} else {
return LNbits.utils.formatMsat(this.receive.amountMsat) + ' sat'
@ -148,7 +146,7 @@ window.PageWallet = {
},
createInvoice() {
this.receive.status = 'loading'
if (LNBITS_DENOMINATION != 'sats') {
if (!this.g.isSatsDenomination) {
this.receive.data.amount = this.receive.data.amount * 100
}

View file

@ -136,7 +136,7 @@ include('components/lnbits-wallet-extra.vue') %}
<q-item-label v-text="$t('amount')"></q-item-label>
<q-item-label caption>
<span v-text="(payment.amount / 1000).toFixed(3)"></span>
<span v-text="LNBITS_DENOMINATION"></span>
<span v-text="g.denomination"></span>
</q-item-label>
</q-item-section>
</q-item>
@ -145,7 +145,7 @@ include('components/lnbits-wallet-extra.vue') %}
<q-item-label v-text="$t('fee')"></q-item-label>
<q-item-label caption>
<span v-text="(payment.fee / 1000).toFixed(3)"></span>
<span v-text="LNBITS_DENOMINATION"></span>
<span v-text="g.denomination"></span>
</q-item-label>
</q-item-section>
</q-item>
@ -460,7 +460,7 @@ include('components/lnbits-wallet-extra.vue') %}
<q-popup-edit class="text-white" v-slot="scope" v-model="credit">
<q-input
filled
:label="$t('credit_label', {denomination: denomination})"
:label="$t('credit_label', {denomination: g.denomination})"
v-model="scope.value"
dense
autofocus
@ -484,7 +484,7 @@ include('components/lnbits-wallet-extra.vue') %}
<q-popup-edit class="text-white" v-slot="scope" v-model="credit">
<q-input
filled
:label="$t('credit_label', {denomination: denomination})"
:label="$t('credit_label', {denomination: g.denomination})"
v-model="scope.value"
type="number"
dense

View file

@ -55,7 +55,7 @@
$t('service_fee_max_badge', {
amount: serviceFee,
max: serviceFeeMax,
denom: denomination
denom: g.denomination
})
"
></span>

View file

@ -317,9 +317,9 @@
</template>
</q-td>
<q-td
v-if="g.isSatsDenomination"
auto-width
key="amount"
v-if="denomination != 'sats'"
:props="props"
class="col1"
v-text="parseFloat(String(props.row.fsat).replaceAll(',', '')) / 100"