mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-28 13:42:42 +02:00
@@ -249,7 +249,9 @@ new Vue({
|
||||
message: 'Tap your NFC tag now to write the LNURLw to it'
|
||||
})
|
||||
|
||||
await ndef.write(lnurl)
|
||||
await ndef.write({
|
||||
records: [{recordType: 'url', data: 'lnurlw://' + lnurl, lang: 'en'}]
|
||||
})
|
||||
|
||||
this.nfcTagWriting = false
|
||||
this.$q.notify({
|
||||
|
@@ -13,7 +13,8 @@
|
||||
:value="this.here + '/?lightning={{lnurl }}'"
|
||||
:options="{width: 800}"
|
||||
class="rounded-borders"
|
||||
></qrcode>
|
||||
>
|
||||
</qrcode>
|
||||
</q-responsive>
|
||||
</a>
|
||||
</div>
|
||||
@@ -61,40 +62,6 @@
|
||||
here: location.protocol + '//' + location.host,
|
||||
nfcTagWriting: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
writeNfcTag: async function (lnurl) {
|
||||
try {
|
||||
if (typeof NDEFReader == 'undefined') {
|
||||
throw {
|
||||
toString: function () {
|
||||
return 'NFC not supported on this device and/or browser.'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ndef = new NDEFReader()
|
||||
|
||||
this.nfcTagWriting = true
|
||||
this.$q.notify({
|
||||
message: 'Tap your NFC tag now to write the LNURLw to it'
|
||||
})
|
||||
|
||||
await ndef.write(lnurl)
|
||||
|
||||
this.nfcTagWriting = false
|
||||
this.$q.notify({
|
||||
message: 'NFC Tag written successfully!'
|
||||
})
|
||||
} catch (error) {
|
||||
this.nfcTagWriting = false
|
||||
this.$q.notify({
|
||||
message: error
|
||||
? error.toString()
|
||||
: 'An unexpected error has occurred'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user