fix(libra): exclude voided txs from balance Pending section

BalancePage filtered tx.flag === '!' to compute pending count/sum/list.
After the libra backend stops hiding voided transactions, those will
arrive with flag='!' plus a 'voided' tag and would otherwise leak into
the Pending section. Add the tag-aware exclusion to keep Pending
showing only genuinely pending entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-06-06 20:45:55 +02:00
commit 1fbf7b3d26

View file

@ -98,8 +98,11 @@ async function loadData() {
totalIncomeSats.value = balanceData.total_income_sats || 0 totalIncomeSats.value = balanceData.total_income_sats || 0
totalIncomeFiat.value = balanceData.total_income_fiat || {} totalIncomeFiat.value = balanceData.total_income_fiat || {}
// Filter for pending transactions (flag = '!') // Filter for pending transactions (flag = '!'), excluding voided ones
pendingTransactions.value = txData.entries.filter(tx => tx.flag === '!') // (libra convention: voided keeps '!' flag and carries a 'voided' tag).
pendingTransactions.value = txData.entries.filter(
tx => tx.flag === '!' && !tx.tags?.includes('voided')
)
} catch (error) { } catch (error) {
console.error('[BalancePage] Error loading data:', error) console.error('[BalancePage] Error loading data:', error)
toast.error('Failed to load balance data') toast.error('Failed to load balance data')