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:
co-authored by
dni ⚡
parent
e8a6870d7a
commit
fbd22c1a22
+21
-17
@@ -211,23 +211,7 @@ new Vue({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
decodeQR: function (res) {
|
lnurlScan() {
|
||||||
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.+-~_]/)) {
|
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.request(
|
.request(
|
||||||
'GET',
|
'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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user