LNURLw: NFC fix uri prefix (#761)

* fix uri prefix

* prettier
This commit is contained in:
calle
2022-07-19 17:20:50 +02:00
committed by GitHub
parent b8c99a15d1
commit 0f73501a88
2 changed files with 5 additions and 36 deletions

View File

@@ -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({

View File

@@ -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>