diff --git a/lnbits/extensions/tpos/templates/tpos/tpos.html b/lnbits/extensions/tpos/templates/tpos/tpos.html
index cfda22c0..e11f6079 100644
--- a/lnbits/extensions/tpos/templates/tpos/tpos.html
+++ b/lnbits/extensions/tpos/templates/tpos/tpos.html
@@ -169,7 +169,9 @@
{% raw %}{{ fsat }}
sat
- ( + {{ tipAmountSat }} tip)
+ ( + {{ tipAmountSat }} tip)
{% endraw %}
@@ -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)