From ab56a565184a58ab00cc933679cbb29bdb79e17b Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 14 Jul 2025 11:46:54 +0100 Subject: [PATCH 1/3] default to LN is no onchain --- static/js/display.js | 10 ++++++---- templates/satspay/display.html | 15 +++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/static/js/display.js b/static/js/display.js index 70a3966..0305ad5 100644 --- a/static/js/display.js +++ b/static/js/display.js @@ -1,7 +1,6 @@ window.app = Vue.createApp({ el: '#vue', mixins: [window.windowMixin], - delimiters: ['${', '}'], data() { return { charge: mapCharge(charge_data), @@ -20,7 +19,7 @@ window.app = Vue.createApp({ return `${url}/address/${this.charge.onchainaddress}` }, unifiedQR() { - const bitcoin = (this.charge.onchainaddress || '').toUpperCase() + const bitcoin = (this.charge.onchainaddress ?? '').toUpperCase() let queryString = `bitcoin:${bitcoin}?amount=${( this.charge.amount / 1e8 ).toFixed(8)}` @@ -38,7 +37,7 @@ window.app = Vue.createApp({ } }, methods: { - initWs: async function () { + async initWs() { const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws' const url = `${protocol}://${window.location.host}/satspay/${this.charge.id}/ws` this.ws = new WebSocket(url) @@ -75,7 +74,10 @@ window.app = Vue.createApp({ }) } }, - created: async function () { + async created() { + if (!this.charge.onchainaddress) { + this.tab = 'ln' + } // add custom-css to make overrides easier if (this.charge.custom_css) { document.body.setAttribute('id', 'custom-css') diff --git a/templates/satspay/display.html b/templates/satspay/display.html index 55607a1..e69e932 100644 --- a/templates/satspay/display.html +++ b/templates/satspay/display.html @@ -3,12 +3,12 @@
-
${charge.name || 'LNbits SatsPay'}
+
- ${line}
@@ -19,7 +19,8 @@ ${charge.id} @@ -56,7 +57,8 @@ - ${charge.pending} sats + +  sats @@ -69,9 +71,10 @@ ${charge.amount - charge.balance > 0 ? charge.amount - - charge.balance : 0} sats +  sats From 7b5348f359ed6cb225974a9190dabacb93ad6835 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 14 Jul 2025 11:49:02 +0100 Subject: [PATCH 2/3] fix: package mode --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 89933cb..71397c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ name = "lnbits-satspay" version = "0.0.0" description = "LNbits, free and open-source Lightning wallet and accounts system." authors = ["Alan Bits "] +package-mode = false [tool.poetry.dependencies] python = "^3.10 | ^3.9" From 197a280a4406c440f0d39752fc37df44cb839899 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 14 Jul 2025 11:49:31 +0100 Subject: [PATCH 3/3] chore: lint --- templates/satspay/display.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/templates/satspay/display.html b/templates/satspay/display.html index e69e932..9e42428 100644 --- a/templates/satspay/display.html +++ b/templates/satspay/display.html @@ -8,8 +8,7 @@ class="text-subtitle1" v-for="line in charge.description.split('\n')" v-text="line" - > -
+ > @@ -20,8 +19,7 @@ class="text-uppercase text-secondary cursor-pointer" @click="copyText(charge.id)" v-text="charge.id" - > + > @@ -70,10 +68,10 @@ - + >  sats