From 3356bab5ca33f8c8c10c2c9ab8307d3c3e890b25 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 24 Nov 2022 17:33:58 +0200 Subject: [PATCH] fix: refresh when both onchain and ln are present --- lnbits/extensions/satspay/templates/satspay/display.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index b69cc829..57b0e7c6 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -328,7 +328,8 @@ }, methods: { checkBalances: async function () { - if (this.charge.hasStaleBalance) return + if (!this.charge.lnbitswallet && this.charge.hasOnchainStaleBalance) + return try { const {data} = await LNbits.api.request( 'GET', @@ -353,7 +354,7 @@ address: this.charge.onchainaddress }) const newBalance = utxos.reduce((t, u) => t + u.value, 0) - this.charge.hasStaleBalance = this.charge.balance === newBalance + this.charge.hasOnchainStaleBalance = this.charge.balance === newBalance this.pendingFunds = utxos .filter(u => !u.status.confirmed) @@ -430,6 +431,7 @@ created: async function () { if (this.charge.lnbitswallet) this.payInvoice() else this.payOnchain() + await this.checkBalances() if (!this.charge.paid) {