Skip to content

Commit 3ffcab2

Browse files
committed
Merge branch 'main' into matthewcroughan/nixify
2 parents 5f3183c + 462fffb commit 3ffcab2

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ venv
3131

3232
__bundle__
3333

34+
coverage.xml
3435
node_modules
3536
lnbits/static/bundle.*
3637
docker

Makefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mypy: $(shell find lnbits -name "*.py")
1717
./venv/bin/mypy lnbits/core
1818
./venv/bin/mypy lnbits/extensions/*
1919

20-
isort: $(shell find lnbits -name "*.py")
20+
isort: $(shell find lnbits -name "*.py")
2121
./venv/bin/isort --profile black lnbits
2222

2323
checkprettier: $(shell find lnbits -name "*.js" -name ".html")
@@ -36,7 +36,6 @@ requirements.txt: Pipfile.lock
3636
cat Pipfile.lock | jq -r '.default | map_values(.version) | to_entries | map("\(.key)\(.value)") | join("\n")' > requirements.txt
3737

3838
test:
39-
rm -rf ./tests/data
4039
mkdir -p ./tests/data
4140
LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \
4241
FAKE_WALLET_SECRET="ToTheMoon1" \
@@ -45,14 +44,12 @@ test:
4544
./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests
4645

4746
test-real-wallet:
48-
rm -rf ./tests/data
4947
mkdir -p ./tests/data
5048
LNBITS_DATA_FOLDER="./tests/data" \
5149
PYTHONUNBUFFERED=1 \
52-
./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests
50+
./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests
5351

5452
test-pipenv:
55-
rm -rf ./tests/data
5653
mkdir -p ./tests/data
5754
LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \
5855
FAKE_WALLET_SECRET="ToTheMoon1" \

lnbits/extensions/tpos/templates/tpos/tpos.html

+10-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ <h3 class="q-my-md">{% raw %}{{ famount }}{% endraw %}</h3>
169169
<h5 class="q-mt-none">
170170
{% raw %}{{ fsat }}
171171
<small>sat</small>
172-
<span style="font-size: 0.75rem">( + {{ tipAmountSat }} tip)</span>
172+
<span v-show="tip_options" style="font-size: 0.75rem"
173+
>( + {{ tipAmountSat }} tip)</span
174+
>
173175
{% endraw %}
174176
</h5>
175177
</div>
@@ -275,7 +277,7 @@ <h5 class="q-mt-none">
275277
return {
276278
tposId: '{{ tpos.id }}',
277279
currency: '{{ tpos.currency }}',
278-
tip_options: JSON.parse('{{ tpos.tip_options }}'),
280+
tip_options: null,
279281
exchangeRate: null,
280282
stack: [],
281283
tipAmount: 0.0,
@@ -352,7 +354,7 @@ <h5 class="q-mt-none">
352354
this.showInvoice()
353355
},
354356
submitForm: function () {
355-
if (this.tip_options.length) {
357+
if (this.tip_options) {
356358
this.showTipModal()
357359
} else {
358360
this.showInvoice()
@@ -417,6 +419,11 @@ <h5 class="q-mt-none">
417419
created: function () {
418420
var getRates = this.getRates
419421
getRates()
422+
this.tip_options =
423+
'{{ tpos.tip_options | tojson }}' == 'null'
424+
? null
425+
: JSON.parse('{{ tpos.tip_options }}')
426+
console.log(typeof this.tip_options, this.tip_options)
420427
setInterval(function () {
421428
getRates()
422429
}, 20000)

tools/conv.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def insert_to_pg(query, data):
102102
print(e)
103103
print(f"Failed to insert {d}")
104104
else:
105+
print("query:", query)
106+
print("data:", d)
105107
raise ValueError(f"Failed to insert {d}")
106108
connection.commit()
107109

@@ -259,9 +261,10 @@ def migrate_ext(sqlite_db_file, schema, ignore_missing=True):
259261
open_time,
260262
used,
261263
usescsv,
262-
webhook_url
264+
webhook_url,
265+
custom_url
263266
)
264-
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
267+
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
265268
"""
266269
insert_to_pg(q, res.fetchall())
267270
# WITHDRAW HASH CHECK

0 commit comments

Comments
 (0)