From 0a210f766db6847b707380ecf6b81e695b49a436 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Tue, 18 Apr 2023 15:39:53 +0100 Subject: [PATCH] allow to scan BIP21 QR codes --- lnbits/core/static/js/wallet.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lnbits/core/static/js/wallet.js b/lnbits/core/static/js/wallet.js index 7068e9ef..0f935686 100644 --- a/lnbits/core/static/js/wallet.js +++ b/lnbits/core/static/js/wallet.js @@ -466,6 +466,16 @@ new Vue({ return } + // BIP-21 support + if(this.parse.data.request.toLowerCase().includes('lightning')){ + this.parse.data.request = this.parse.data.request.split('lightning=')[1] + + // fail safe to check there's nothing after the lightning= part + if(this.parse.data.request.includes('&')){ + this.parse.data.request = this.parse.data.request.split('&')[0] + } + } + let invoice try { invoice = decode(this.parse.data.request)