mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-22 22:25:47 +01:00
fix: QR request case (#2668)
* fix the hotfix to fix a fuckup
* fixup!
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
This commit is contained in:
parent
e8a6870d7a
commit
fbd22c1a22
1 changed files with 51 additions and 47 deletions
|
@ -211,23 +211,7 @@ new Vue({
|
|||
})
|
||||
}
|
||||
},
|
||||
decodeQR: function (res) {
|
||||
this.parse.data.request = res
|
||||
this.decodeRequest()
|
||||
this.parse.camera.show = false
|
||||
},
|
||||
decodeRequest: function () {
|
||||
this.parse.show = true
|
||||
let req = this.parse.data.request.toLowerCase()
|
||||
if (req.startsWith('lightning:')) {
|
||||
this.parse.data.request = req.slice(10)
|
||||
} else if (req.startsWith('lnurl:')) {
|
||||
this.parse.data.request = req.slice(6)
|
||||
} else if (req.includes('lightning=lnurl1')) {
|
||||
this.parse.data.request = req.split('lightning=')[1].split('&')[0]
|
||||
}
|
||||
req = this.parse.data.request
|
||||
if (req.startsWith('lnurl1') || req.match(/[\w.+-~_]+@[\w.+-~_]/)) {
|
||||
lnurlScan() {
|
||||
LNbits.api
|
||||
.request(
|
||||
'GET',
|
||||
|
@ -274,6 +258,26 @@ new Vue({
|
|||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
decodeQR: function (res) {
|
||||
this.parse.data.request = res
|
||||
this.decodeRequest()
|
||||
this.parse.camera.show = false
|
||||
},
|
||||
decodeRequest: function () {
|
||||
this.parse.show = true
|
||||
this.parse.data.request = this.parse.data.request.trim().toLowerCase()
|
||||
let req = this.parse.data.request
|
||||
if (req.startsWith('lightning:')) {
|
||||
this.parse.data.request = req.slice(10)
|
||||
} else if (req.startsWith('lnurl:')) {
|
||||
this.parse.data.request = req.slice(6)
|
||||
} else if (req.includes('lightning=lnurl1')) {
|
||||
this.parse.data.request = req.split('lightning=')[1].split('&')[0]
|
||||
}
|
||||
req = this.parse.data.request
|
||||
if (req.startsWith('lnurl1') || req.match(/[\w.+-~_]+@[\w.+-~_]/)) {
|
||||
this.lnurlScan()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue