diff options
author | Marc Stibane <marc@taler.net> | 2024-04-05 22:06:01 +0200 |
---|---|---|
committer | Marc Stibane <marc@taler.net> | 2024-04-05 22:06:01 +0200 |
commit | 4bc9b767af2d3e2bb456be151c2ac5a071462d54 (patch) | |
tree | ecfa4d375f6b4b3a81d3c3a30c877b11c44f7723 | |
parent | a54c48846a3b3a7e0da8100edb4f8d73817ee67c (diff) | |
download | taler-ios-4bc9b767af2d3e2bb456be151c2ac5a071462d54.tar.gz taler-ios-4bc9b767af2d3e2bb456be151c2ac5a071462d54.tar.bz2 taler-ios-4bc9b767af2d3e2bb456be151c2ac5a071462d54.zip |
add DepositWithdrawV to Balances
-rw-r--r-- | TalerWallet1/Views/Balances/BalancesSectionView.swift | 50 | ||||
-rw-r--r-- | 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 { |