diff --git a/static/js/tpos.js b/static/js/tpos.js index 3e770f0..9574789 100644 --- a/static/js/tpos.js +++ b/static/js/tpos.js @@ -103,7 +103,7 @@ window.app = Vue.createApp({ } }, computed: { - amount: function () { + amount() { if (!this.stack.length) return 0.0 if (this.currency == 'sats') return Number(this.stack.join('')) return ( @@ -111,34 +111,34 @@ window.app = Vue.createApp({ (this.currency == 'sats' ? 1 : 0.01) ) }, - amountFormatted: function () { + amountFormatted() { return this.formatAmount(this.amount, this.currency) }, totalFormatted() { return this.formatAmount(this.total, this.currency) }, - amountWithTipFormatted: function () { + amountWithTipFormatted() { return this.formatAmount(this.amount + this.tipAmount, this.currency) }, - sat: function () { + sat() { if (!this.exchangeRate) return 0 return Math.ceil(this.amount * this.exchangeRate) }, - totalSat: function () { + totalSat() { if (!this.exchangeRate) return 0 return Math.ceil(this.total * this.exchangeRate) }, - tipAmountSat: function () { + tipAmountSat() { if (!this.exchangeRate) return 0 return Math.ceil(this.tipAmount * this.exchangeRate) }, - tipAmountFormatted: function () { + tipAmountFormatted() { return LNbits.utils.formatSat(this.tipAmountSat) }, - fsat: function () { + fsat() { return LNbits.utils.formatSat(this.sat) }, - totalfsat: function () { + totalfsat() { return LNbits.utils.formatSat(this.totalSat) }, roundToSugestion() { @@ -658,8 +658,7 @@ window.app = Vue.createApp({ LNbits.api .request('GET', `/tpos/api/v1/rate/${this.currency}`) .then(response => { - this.exchangeRate = response.data.rate - console.log(this.exchangeRate) + this.exchangeRate = response.data.rate[0] Quasar.Loading.hide() }) .catch(e => console.error(e))