This commit is contained in:
callebtc 2022-11-07 16:54:25 +01:00
parent 2db8006d9e
commit fbd8f6a8e5

View file

@ -1228,8 +1228,7 @@ page_container %}
this.camera.show = false this.camera.show = false
}, },
decodeRequest: function () { decodeRequest: function () {
// let req = this.payInvoiceData.data.request.toLowerCase() let reqtype = null
reqtype = null
let req = this.camera.data let req = this.camera.data
if (req.toLowerCase().startsWith('lnbc')) { if (req.toLowerCase().startsWith('lnbc')) {
this.payInvoiceData.data.request = req this.payInvoiceData.data.request = req
@ -1252,9 +1251,11 @@ page_container %}
this.payInvoiceData.data.request = req this.payInvoiceData.data.request = req
reqtype = 'lnurl' reqtype = 'lnurl'
return return
} else if (req.indexOf('cashu:') !== 1) {
this.receiveData.tokensBase64 = req.slice(req.indexOf('cashu:'))
reqtype = 'cashu'
} else if (req.indexOf('W3siaWQ') !== 1) { } else if (req.indexOf('W3siaWQ') !== 1) {
// very dirty way of parsing cashu tokens // very dirty way of parsing cashu tokens
this.receiveData.tokensBase64 = req.slice(req.indexOf('W3siaWQ')) this.receiveData.tokensBase64 = req.slice(req.indexOf('W3siaWQ'))
reqtype = 'cashu' reqtype = 'cashu'
} }