From 361a87110bc5763959e96819e07fc3ebf9eaf4c3 Mon Sep 17 00:00:00 2001 From: Ben Arc Date: Tue, 20 Apr 2021 17:26:38 +0100 Subject: [PATCH] Fixed couple of display bugs --- lnbits/extensions/copilot/tasks.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/copilot/tasks.py b/lnbits/extensions/copilot/tasks.py index 5407135b..93a30b6e 100644 --- a/lnbits/extensions/copilot/tasks.py +++ b/lnbits/extensions/copilot/tasks.py @@ -41,15 +41,15 @@ async def on_invoice_paid(payment: Payment) -> None: HTTPStatus.NOT_FOUND, ) if copilot.animation1threshold: - if int(payment.amount) > copilot.animation1threshold: + if int(payment.amount/1000) > copilot.animation1threshold: data = copilot.animation1 webhook = copilot.animation1webhook if copilot.animation2threshold: - if int(payment.amount) > copilot.animation2threshold: + if int(payment.amount/1000) > copilot.animation2threshold: data = copilot.animation2 webhook = copilot.animation1webhook if copilot.animation3threshold: - if int(payment.amount) > copilot.animation3threshold: + if int(payment.amount/1000) > copilot.animation3threshold: data = copilot.animation3 webhook = copilot.animation1webhook if webhook: @@ -68,7 +68,10 @@ async def on_invoice_paid(payment: Payment) -> None: await mark_webhook_sent(payment, r.status_code) except (httpx.ConnectError, httpx.RequestError): await mark_webhook_sent(payment, -1) - await updater(data, payment.extra.get("comment"), copilot.id) + if payment.extra.get("comment"): + await updater(data, payment.extra.get("comment"), copilot.id) + + await updater(data, "none", copilot.id) async def mark_webhook_sent(payment: Payment, status: int) -> None: