chore: cleanup LNBITS_DENOMINATION global var (#3580)
This commit is contained in:
parent
da31e3caaa
commit
c6c67c52db
11 changed files with 18 additions and 32 deletions
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
$t('service_fee_max_badge', {
|
||||
amount: serviceFee,
|
||||
max: serviceFeeMax,
|
||||
denom: denomination
|
||||
denom: g.denomination
|
||||
})
|
||||
"
|
||||
></span>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue