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