Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NFC button #61

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 24 additions & 29 deletions templates/tpos/tpos.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,29 +405,34 @@ <h5 class="q-mt-none q-mb-sm">${totalfsat}<small> sat</small></h5>
v-if="invoiceDialog.data"
class="q-pa-lg q-pt-xl lnbits__dialog-card"
>
<q-responsive :ratio="1" class="q-mx-xl q-mb-md">
<lnbits-qrcode
:value="'lightning:' + invoiceDialog.data.payment_request.toUpperCase()"
:options="{width: 800}"
class="rounded-borders"
></lnbits-qrcode>
</q-responsive>
<a
:href="'lightning:' + invoiceDialog.data.payment_request.toUpperCase()"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: put this expression into a computed method (used in two places):
'lightning:' + invoiceDialog.data.payment_request.toUpperCase()

target="_blank"
rel="noopener noreferrer"
>
<q-responsive :ratio="1" class="q-mx-xl q-mb-md">
<lnbits-qrcode
:value="'lightning:' + invoiceDialog.data.payment_request.toUpperCase()"
:options="{width: 800}"
class="rounded-borders"
></lnbits-qrcode>
</q-responsive>
<q-tooltip>Pay in wallet</q-tooltip>
</a>
<div class="text-center">
<h3 class="q-my-md">${ amountWithTipFormatted }</h3>
<h5 class="q-mt-none">
<h5 class="q-mt-none q-mb-sm">
${ fsat }
<small> sat</small>
<span v-show="tip_options" style="font-size: 0.75rem"
>( + ${ tipAmountFormatted } tip)</span
>
</h5>
<q-btn
outline
color="grey"
icon="nfc"
@click="readNfcTag()"
:disable="nfcTagReading"
></q-btn>
<q-chip v-if="nfcTagReading" square>
<q-avatar icon="nfc" color="positive" text-color="white"></q-avatar>
NFC supported
</q-chip>
<span v-else class="text-caption text-grey">NFC not supported</span>
</div>
<div class="row q-mt-lg">
<q-btn
Expand All @@ -436,14 +441,6 @@ <h5 class="q-mt-none">
@click="copyText(invoiceDialog.data.payment_request)"
>Copy invoice</q-btn
>
<q-btn
outline
color="grey"
class="q-ml-md"
type="a"
:href="'lightning:'+invoiceDialog.data.payment_request"
>Pay in wallet</q-btn
>
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Close</q-btn>
</div>
</q-card>
Expand Down Expand Up @@ -738,7 +735,7 @@ <h5 class="q-mt-none">
rowsPerPage: 10
}
},
monochrome: this.$q.localStorage.getItem('lnbits.tpos.color'),
monochrome: this.$q.localStorage.getItem('lnbits.tpos.color') || false,
showPoS: true,
cartDrawer: this.$q.screen.width > 1200,
searchTerm: '',
Expand Down Expand Up @@ -1036,6 +1033,7 @@ <h5 class="q-mt-none">
.then(function (response) {
dialog.data = response.data
dialog.show = true
self.readNfcTag()

dialog.dismissMsg = self.$q.notify({
timeout: 0,
Expand Down Expand Up @@ -1072,11 +1070,8 @@ <h5 class="q-mt-none">
const self = this

if (typeof NDEFReader == 'undefined') {
throw {
toString: function () {
return 'NFC not supported on this device or browser.'
}
}
console.debug('NFC not supported on this device or browser.')
return
}

const ndef = new NDEFReader()
Expand Down