display NFC button on supported and fix null tip options

This commit is contained in:
Tiago vasconcelos 2022-09-07 16:39:08 +01:00
parent ddc3ec7e2f
commit 0177316075

View file

@ -175,6 +175,7 @@
{% endraw %}
</h5>
<q-btn
v-if="hasNFC"
outline
color="grey"
icon="nfc"
@ -294,6 +295,7 @@
exchangeRate: null,
stack: [],
tipAmount: 0.0,
hasNFC: false,
nfcTagReading: false,
invoiceDialog: {
show: false,
@ -370,7 +372,7 @@
this.showInvoice()
},
submitForm: function () {
if (this.tip_options.length) {
if (this.tip_options && this.tip_options.length) {
this.showTipModal()
} else {
this.showInvoice()
@ -544,6 +546,8 @@
setInterval(function () {
getRates()
}, 120000)
this.hasNFC = 'NDEFReader' in window
}
})
</script>