chore: cleanup LNBITS_DENOMINATION global var (#3580)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user