fix older tpos without tips (#778)

This commit is contained in:
Tiago Vasconcelos 2022-07-25 11:52:28 +01:00 committed by GitHub
parent 7fbea79e62
commit 27b4db9877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,7 +169,9 @@
<h5 class="q-mt-none">
{% raw %}{{ fsat }}
<small>sat</small>
<span style="font-size: 0.75rem">( + {{ tipAmountSat }} tip)</span>
<span v-show="tip_options" style="font-size: 0.75rem"
>( + {{ tipAmountSat }} tip)</span
>
{% endraw %}
</h5>
</div>
@ -275,7 +277,7 @@
return {
tposId: '{{ tpos.id }}',
currency: '{{ tpos.currency }}',
tip_options: JSON.parse('{{ tpos.tip_options }}'),
tip_options: null,
exchangeRate: null,
stack: [],
tipAmount: 0.0,
@ -352,7 +354,7 @@
this.showInvoice()
},
submitForm: function () {
if (this.tip_options.length) {
if (this.tip_options) {
this.showTipModal()
} else {
this.showInvoice()
@ -417,6 +419,11 @@
created: function () {
var getRates = this.getRates
getRates()
this.tip_options =
'{{ tpos.tip_options | tojson }}' == 'null'
? null
: JSON.parse('{{ tpos.tip_options }}')
console.log(typeof this.tip_options, this.tip_options)
setInterval(function () {
getRates()
}, 20000)