mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 12:26:19 +02:00
Merge pull request #19 from frennkie/allow-lightning-scheme
Allow lightning scheme
This commit is contained in:
@@ -248,8 +248,13 @@ new Vue({
|
|||||||
this.sendCamera.show = false;
|
this.sendCamera.show = false;
|
||||||
},
|
},
|
||||||
decodeInvoice: function () {
|
decodeInvoice: function () {
|
||||||
|
if (this.send.data.bolt11.startsWith('lightning:')) {
|
||||||
|
this.send.data.bolt11 = this.send.data.bolt11.slice(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
let invoice;
|
||||||
try {
|
try {
|
||||||
var invoice = decode(this.send.data.bolt11);
|
invoice = decode(this.send.data.bolt11);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
@@ -261,7 +266,7 @@ new Vue({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cleanInvoice = {
|
let cleanInvoice = {
|
||||||
msat: invoice.human_readable_part.amount,
|
msat: invoice.human_readable_part.amount,
|
||||||
sat: invoice.human_readable_part.amount / 1000,
|
sat: invoice.human_readable_part.amount / 1000,
|
||||||
fsat: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000)
|
fsat: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000)
|
||||||
|
Reference in New Issue
Block a user