Fix: Allow the LNURL spec fallback scheme for LNURLw (#3961)
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -8,6 +8,10 @@ window.app.component('lnbits-qrcode-lnurl', {
|
|||||||
prefix: {
|
prefix: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'lnurlp'
|
default: 'lnurlp'
|
||||||
|
},
|
||||||
|
href: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -21,7 +25,10 @@ window.app.component('lnbits-qrcode-lnurl', {
|
|||||||
if (this.tab == 'bech32') {
|
if (this.tab == 'bech32') {
|
||||||
const bytes = new TextEncoder().encode(this.url)
|
const bytes = new TextEncoder().encode(this.url)
|
||||||
const bech32 = NostrTools.nip19.encodeBytes('lnurl', bytes)
|
const bech32 = NostrTools.nip19.encodeBytes('lnurl', bytes)
|
||||||
this.lnurl = `lightning:${bech32.toUpperCase()}`
|
this.lnurl =
|
||||||
|
this.href && this.href.trim() !== ''
|
||||||
|
? `${this.href}?lightning=${bech32.toUpperCase()}`
|
||||||
|
: `lightning:${bech32.toUpperCase()}`
|
||||||
} else if (this.tab == 'lud17') {
|
} else if (this.tab == 'lud17') {
|
||||||
if (this.url.startsWith('http://')) {
|
if (this.url.startsWith('http://')) {
|
||||||
this.lnurl = this.url.replace('http://', this.prefix + '://')
|
this.lnurl = this.url.replace('http://', this.prefix + '://')
|
||||||
|
|||||||
Reference in New Issue
Block a user