Fix: Allow the LNURL spec fallback scheme for LNURLw (#3961)

This commit is contained in:
Tiago Vasconcelos
2026-06-03 10:25:11 +02:00
committed by GitHub
parent a1d94834ae
commit 1e0fc84586
2 changed files with 9 additions and 2 deletions
File diff suppressed because one or more lines are too long
@@ -8,6 +8,10 @@ window.app.component('lnbits-qrcode-lnurl', {
prefix: {
type: String,
default: 'lnurlp'
},
href: {
type: String,
default: ''
}
},
data() {
@@ -21,7 +25,10 @@ window.app.component('lnbits-qrcode-lnurl', {
if (this.tab == 'bech32') {
const bytes = new TextEncoder().encode(this.url)
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') {
if (this.url.startsWith('http://')) {
this.lnurl = this.url.replace('http://', this.prefix + '://')