[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 25/32: use ScopeInfo
From: |
gnunet |
Subject: |
[taler-taler-ios] 25/32: use ScopeInfo |
Date: |
Sat, 10 Feb 2024 15:04:51 +0100 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 4eea188fbd2c8b0d90c7d4a22017361d9400afe7
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Feb 8 17:51:37 2024 +0100
use ScopeInfo
---
.../Views/Balances/BalancesSectionView.swift | 5 +++--
.../Views/Banking/ExchangeSectionView.swift | 2 +-
TalerWallet1/Views/HelperViews/BarGraph.swift | 21 +++++++++++++--------
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index aaa9f12..3292272 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -59,7 +59,8 @@ extension BalancesSectionView: View {
let _ = Self._printChanges()
let _ = symLog.vlog() // just to get the # to compare it with
.onAppear & onDisappear
#endif
- let currency = balance.scopeInfo.currency
+ let scopeInfo = balance.scopeInfo
+ let currency = scopeInfo.currency
let currencyInfo = controller.info(for: currency)
Section {
@@ -100,7 +101,7 @@ extension BalancesSectionView: View {
.padding(.leading, ICONLEADING)
}
} header: {
- BarGraphHeader(stack: stack.push(), currency: currency,
+ BarGraphHeader(stack: stack.push(), scopeInfo: scopeInfo,
currencyName: currencyInfo?.scope.currency ?? currency,
shouldReloadBalances: $shouldReloadBalances)
}.id(sectionID)
diff --git a/TalerWallet1/Views/Banking/ExchangeSectionView.swift
b/TalerWallet1/Views/Banking/ExchangeSectionView.swift
index 0b6c49e..e6b59c7 100644
--- a/TalerWallet1/Views/Banking/ExchangeSectionView.swift
+++ b/TalerWallet1/Views/Banking/ExchangeSectionView.swift
@@ -47,7 +47,7 @@ struct ExchangeSectionView: View {
.padding(.top)
}
} header: {
- BarGraphHeader(stack: stack.push(), currency: currency,
currencyName: currencyName,
+ BarGraphHeader(stack: stack.push(), scopeInfo: nil, currencyName:
currencyName,
shouldReloadBalances: $shouldReloadBalances)
}
}
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index 0e7a366..9221d4a 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -10,7 +10,7 @@ let MAXBARS = 10
struct BarGraphHeader: View {
private let symLog = SymLogV(0)
let stack: CallStack
- let currency: String
+ let scopeInfo: ScopeInfo?
let currencyName: String
@Binding var shouldReloadBalances: Int
@@ -25,15 +25,20 @@ struct BarGraphHeader: View {
Text(currencyName)
.accessibilityFont(.title2)
// .foregroundColor(colorSchemeContrast == .increased ?
.primary : .secondary)
- BarGraph(transactions: $completedTransactions,
- maxBars: MAXBARS, barHeight: barHeight)
+ if let scopeInfo {
+ BarGraph(transactions: $completedTransactions,
+ maxBars: MAXBARS, barHeight: barHeight)
+ }
}
.task(id: shouldReloadBalances + 2_000_000) {
- symLog.log(".task for BarGraphHeader(\(currency)) - reload
Transactions")
- // TODO: only load the 10 most recent transactions
- let response = await model.transactionsT(stack.push(".task -
reload Transactions for \(currency)"),
- currency: currency)
- completedTransactions = WalletModel.completedTransactions(response)
+ if let scopeInfo {
+ symLog.log(".task for BarGraphHeader(\(scopeInfo.currency)) -
reload Transactions")
+ // TODO: only load the 10 most recent transactions
+ let response = await model.transactionsT(stack.push(".task -
reload Transactions for \(scopeInfo.currency)"),
+// scopeInfo:
scopeInfo)
+ currency:
scopeInfo.currency)
+ completedTransactions =
WalletModel.completedTransactions(response)
+ }
}
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 12/32: devExperiment Refresh, (continued)
- [taler-taler-ios] 12/32: devExperiment Refresh, gnunet, 2024/02/10
- [taler-taler-ios] 11/32: Identifiable, gnunet, 2024/02/10
- [taler-taler-ios] 28/32: RotatingTaler while waiting for tx to finish, gnunet, 2024/02/10
- [taler-taler-ios] 23/32: TransactionDetailV, gnunet, 2024/02/10
- [taler-taler-ios] 19/32: Show merchant in payment details, gnunet, 2024/02/10
- [taler-taler-ios] 15/32: githash 7 chars, gnunet, 2024/02/10
- [taler-taler-ios] 22/32: CallStack, gnunet, 2024/02/10
- [taler-taler-ios] 10/32: ScrollVStack, gnunet, 2024/02/10
- [taler-taler-ios] 24/32: static func <, gnunet, 2024/02/10
- [taler-taler-ios] 29/32: cleanup, gnunet, 2024/02/10
- [taler-taler-ios] 25/32: use ScopeInfo,
gnunet <=