diff --git a/lnbits/extensions/satspay/models.py b/lnbits/extensions/satspay/models.py index 325ce817e..e8638d5e2 100644 --- a/lnbits/extensions/satspay/models.py +++ b/lnbits/extensions/satspay/models.py @@ -49,7 +49,6 @@ class Charges(BaseModel): def time_elapsed(self): return self.time_left < 0 - @property def paid(self): if self.balance >= self.amount: diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 3108324e7..396200cf1 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -128,6 +128,7 @@
{{props.row.timeLeft}}
@@ -580,16 +581,23 @@ this.createCharge(wallet, data) }, refreshActiveChargesBalance: async function () { - const activeLinkIds = this.chargeLinks - .filter(c => !c.paid && !c.time_elapsed && !c.hasStaleBalance) - .map(c => c.id) - .join(',') - await LNbits.api.request( - 'GET', - '/satspay/api/v1/charges/balance/' + activeLinkIds, - 'filla' - ) - await this.getCharges() + try { + const activeLinkIds = this.chargeLinks + .filter(c => !c.paid && !c.time_elapsed && !c.hasStaleBalance) + .map(c => c.id) + .join(',') + if (activeLinkIds) { + await LNbits.api.request( + 'GET', + '/satspay/api/v1/charges/balance/' + activeLinkIds, + 'filla' + ) + } + } catch (error) { + LNbits.utils.notifyApiError(error) + } finally { + await this.getCharges() + } }, refreshBalance: async function (charge) { try {