[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 09/11: add DepositWithdrawV to Balances
From: |
gnunet |
Subject: |
[taler-taler-ios] 09/11: add DepositWithdrawV to Balances |
Date: |
Fri, 05 Apr 2024 22:56:10 +0200 |
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 4bc9b767af2d3e2bb456be151c2ac5a071462d54
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Apr 5 22:06:01 2024 +0200
add DepositWithdrawV to Balances
---
.../Views/Balances/BalancesSectionView.swift | 50 +++++++++++++---------
TalerWallet1/Views/Main/WalletEmptyView.swift | 2 +-
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 7a87a57..03113c0 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -43,12 +43,12 @@ struct BalancesSectionView {
@State private var shownSectionID = UUID() // guaranteed to be different
the first time
func reloadCompleted(_ stack: CallStack) async -> () {
- transactions = await model.transactionsT(stack.push(), scopeInfo:
balance.scopeInfo)
+ transactions = await model.transactionsT(stack.push(), scopeInfo:
balance.scopeInfo, includeRefreshes: true)
completedTransactions = WalletModel.completedTransactions(transactions)
}
func reloadPending(_ stack: CallStack) async -> () {
- transactions = await model.transactionsT(stack.push(), scopeInfo:
balance.scopeInfo)
+ transactions = await model.transactionsT(stack.push(), scopeInfo:
balance.scopeInfo, includeRefreshes: true)
pendingTransactions = WalletModel.pendingTransactions(transactions)
}
}
@@ -70,15 +70,6 @@ extension BalancesSectionView: View {
.talerFont(.headline)
.listRowSeparator(.hidden)
}
- let showSpendingButton = DEMOCURRENCY == currency &&
!balance.available.isZero
- if showSpendingButton {
- if !minimalistic && showSpendingHint {
- Text("You can spend these \(currencyInfo?.scope.currency
?? currency) in the Demo shop, or send them to another wallet.")
- .talerFont(.body)
- .multilineTextAlignment(.leading)
- .listRowSeparator(.hidden)
- }
- }
BalancesNavigationLinksView(symLog: symLog,
stack: stack.push(),
balance: balance,
@@ -87,6 +78,25 @@ extension BalancesSectionView: View {
completedTransactions: $completedTransactions,
reloadAllAction: reloadCompleted,
reloadOneAction: reloadOneAction)
+ if pendingTransactions.count > 0 {
+ BalancesPendingRowView(symLog: symLog,
+ stack: stack.push(),
+ balance: balance,
+ pendingTransactions: $pendingTransactions,
+ reloadPending: reloadPending,
+ reloadOneAction: reloadOneAction)
+ .padding(.leading, ICONLEADING)
+ }
+ let currencyName = currencyInfo?.scope.currency ?? currency
+ let showSpendingButton = DEMOCURRENCY == currency &&
!balance.available.isZero
+ if showSpendingButton {
+ if !minimalistic && showSpendingHint {
+ Text("You can spend these \(currencyName) in the Demo
shop, or send them to another wallet.")
+ .talerFont(.body)
+ .multilineTextAlignment(.leading)
+ .listRowSeparator(.hidden)
+ }
+ }
if showSpendingButton {
let title = String(localized: "LinkTitle_DEMOSHOP",
defaultValue: "Spend test money")
Button(title) {
@@ -97,15 +107,13 @@ extension BalancesSectionView: View {
.accessibilityHint("Will go to the demo shop website.")
.listRowSeparator(.hidden)
}
- if pendingTransactions.count > 0 {
- BalancesPendingRowView(symLog: symLog,
- stack: stack.push(),
- balance: balance,
- pendingTransactions: $pendingTransactions,
- reloadPending: reloadPending,
- reloadOneAction: reloadOneAction)
- .padding(.leading, ICONLEADING)
- }
+ DepositWithdrawV(stack: stack.push(),
+ scopeInfo: balance.scopeInfo,
+ amountAvailable: balance.available,
+ currency: currencyName,
+ amountToTransfer: $amountToTransfer) // does still have
the wrong currency
+ .listRowSeparator(.hidden)
+
} header: {
BarGraphHeader(stack: stack.push(), scopeInfo: scopeInfo,
currencyName: currencyInfo?.scope.currency ?? currency,
@@ -115,7 +123,7 @@ extension BalancesSectionView: View {
// if shownSectionID != sectionID {
symLog.log(".task for BalancesSectionView - reload
Transactions")
// TODO: only load the MAXRECENT most recent transactions
- let response = await model.transactionsT(stack.push(".task -
reload Transactions"), scopeInfo: scopeInfo)
+ let response = await model.transactionsT(stack.push(".task -
reload Transactions"), scopeInfo: scopeInfo, includeRefreshes: true)
transactions = response
pendingTransactions = WalletModel.pendingTransactions(response)
completedTransactions =
WalletModel.completedTransactions(response)
diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift
b/TalerWallet1/Views/Main/WalletEmptyView.swift
index 0a4f3e0..a99a06f 100644
--- a/TalerWallet1/Views/Main/WalletEmptyView.swift
+++ b/TalerWallet1/Views/Main/WalletEmptyView.swift
@@ -30,7 +30,7 @@ struct WalletEmptyView: View {
Text("Use the QR code scan button to start a withdrawal if
your bank already supports Taler payments.")
.talerFont(.body)
.listRowSeparator(.hidden)
- Text("You can also add a payment service manually on the
Banking tab.")
+ Text("You can also add a payment service manually in the
Settings.")
.talerFont(.body)
}
Section {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (25d37c2 -> 0e970ad), gnunet, 2024/04/05
- [taler-taler-ios] 01/11: setConfig(devModeActive), gnunet, 2024/04/05
- [taler-taler-ios] 05/11: fix fatal error: Duplicate keys of type were found in a Dictionary, gnunet, 2024/04/05
- [taler-taler-ios] 02/11: terms-exchange prep, gnunet, 2024/04/05
- [taler-taler-ios] 03/11: prepare DepositWithdrawV, gnunet, 2024/04/05
- [taler-taler-ios] 04/11: flags, includeRefreshes, make error parts optional, gnunet, 2024/04/05
- [taler-taler-ios] 06/11: Remove Banking tab, gnunet, 2024/04/05
- [taler-taler-ios] 07/11: Settings: add Payment Services, gnunet, 2024/04/05
- [taler-taler-ios] 09/11: add DepositWithdrawV to Balances,
gnunet <=
- [taler-taler-ios] 10/11: use DepositWithdrawV in Exchanges, gnunet, 2024/04/05
- [taler-taler-ios] 08/11: ScopeInfo, gnunet, 2024/04/05
- [taler-taler-ios] 11/11: dev-experiment/start-block-refresh, gnunet, 2024/04/05