commit d25e0bc71c6a8c53af084a74fd94cd83a180032a
parent e482ebf0ec103a1c2e85c58530958eb68f9ef2dd
Author: Marc Stibane <marc@taler.net>
Date: Mon, 22 Jun 2026 09:21:05 +0200
Show discounts & passes
Diffstat:
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift
@@ -55,6 +55,11 @@ struct BalancesListView: View {
historyTapped: $historyTapped,
reloadTransactions: $reloadTransactions)
}
+#if DEBUG
+ if count > 1 { // otherwise it comes before recentTransactions
+ DiscountPassesSection(stack: stack.push())
+ }
+#endif
}
.listStyle(myListStyle.style).anyView
.background(FullBackground())
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -154,23 +154,28 @@ extension BalancesSectionView: View {
await loadPending(stack.push(".task - load pending"))
await loadScanned(stack.push(".task - load scanned"))
}
-
- /// if there is only one currency, then show MAXRECENT recent transactions
- let recentCount = recentTransactions.count
- if sectionCount == 1 && recentCount > 0 {
- let _ = symLog.log("recent transactions")
- let recentHeader = minimalistic ? nil
- : recentCount > 1
- ? String(localized: "Recent transactions", comment: "section header plural")
- : String(localized: "Recent transaction", comment: "section header singular")
- TransactionsArraySection(symLog: symLog,
- logger: logger,
- stack: stack.push(),
- header: recentHeader,
- scope: scopeInfo,
- transactions: $recentTransactions,
- reloadAllAction: loadRecent)
- } // recent transactions
+ if sectionCount == 1 {
+#if DEBUG
+ // show Discounts & Passes before recents
+ DiscountPassesSection(stack: stack.push())
+#endif
+ // if there is only one currency, then show MAXRECENT recent transactions
+ let recentCount = recentTransactions.count
+ if recentCount > 0 {
+ let _ = symLog.log("recent transactions")
+ let recentHeader = minimalistic ? nil
+ : recentCount > 1
+ ? String(localized: "Recent transactions", comment: "section header plural")
+ : String(localized: "Recent transaction", comment: "section header singular")
+ TransactionsArraySection(symLog: symLog,
+ logger: logger,
+ stack: stack.push(),
+ header: recentHeader,
+ scope: scopeInfo,
+ transactions: $recentTransactions,
+ reloadAllAction: loadRecent)
+ } // recent transactions
+ } // 1 Section only
} // body
} // BalancesSectionView
// MARK: -