count pending balances as valid

This commit is contained in:
sneurlax 2024-07-02 11:46:09 -05:00
parent a69cc80e61
commit 8faac03954

View file

@ -72,13 +72,18 @@ class WalletSummaryInfo extends ConsumerWidget {
List<FiroType> getAvailableBalances(FiroWallet firoWallet) { List<FiroType> getAvailableBalances(FiroWallet firoWallet) {
final List<FiroType> availableBalances = []; final List<FiroType> availableBalances = [];
if (firoWallet.info.cachedBalanceTertiary.spendable.raw > BigInt.zero) { if (firoWallet.info.cachedBalanceTertiary.spendable.raw > BigInt.zero ||
firoWallet.info.cachedBalanceTertiary.pendingSpendable.raw >
BigInt.zero) {
availableBalances.add(FiroType.spark); availableBalances.add(FiroType.spark);
} }
if (firoWallet.info.cachedBalanceSecondary.spendable.raw > BigInt.zero) { if (firoWallet.info.cachedBalanceSecondary.spendable.raw > BigInt.zero ||
firoWallet.info.cachedBalanceSecondary.pendingSpendable.raw >
BigInt.zero) {
availableBalances.add(FiroType.lelantus); availableBalances.add(FiroType.lelantus);
} }
if (firoWallet.info.cachedBalance.spendable.raw > BigInt.zero) { if (firoWallet.info.cachedBalance.spendable.raw > BigInt.zero ||
firoWallet.info.cachedBalance.pendingSpendable.raw > BigInt.zero) {
availableBalances.add(FiroType.public); availableBalances.add(FiroType.public);
} }
return availableBalances; return availableBalances;