taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 6fec1ca046dba916cd83e2bbf44e937f2a35b1f9
parent ad9c37680281ac2987a4b59ed9c16a20c21d89d7
Author: Marc Stibane <marc@taler.net>
Date:   Fri, 17 Nov 2023 14:45:24 +0100

cleanup, debugging

Diffstat:
MTalerWallet1/Backend/WalletCore.swift | 2+-
MTalerWallet1/Views/Balances/BalancesSectionView.swift | 19+++++++++----------
MTalerWallet1/Views/Exchange/ManualWithdraw.swift | 6++++--
MTalerWallet1/Views/Peer2peer/RequestPayment.swift | 5+++--
MTalerWallet1/Views/Peer2peer/SendAmount.swift | 2++
MTalerWallet1/Views/Settings/SettingsView.swift | 3+++
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift | 2+-
MTalerWallet1/Views/Transactions/ManualDetailsV.swift | 10+++++-----
8 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/TalerWallet1/Backend/WalletCore.swift b/TalerWallet1/Backend/WalletCore.swift @@ -133,7 +133,7 @@ extension WalletCore { } do { let jsonData = try JSONEncoder().encode(result) - symLog.log(result) + symLog.log("id:\(requestId) \(result)") // logger.info(result) TODO: log result completion(requestId, timeSent, jsonData, nil) } catch { // JSON encoding of response.result failed / should never happen diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift b/TalerWallet1/Views/Balances/BalancesSectionView.swift @@ -44,21 +44,18 @@ struct BalancesSectionView { let currency = balance.scopeInfo.currency transactions = await model.transactionsT(stack.push(), currency: currency) completedTransactions = WalletModel.completedTransactions(transactions) -// sectionID = UUID() } func reloadPending(_ stack: CallStack) async -> () { let currency = balance.scopeInfo.currency transactions = await model.transactionsT(stack.push(), currency: currency) pendingTransactions = WalletModel.pendingTransactions(transactions) -// sectionID = UUID() } func reloadIncomplete(_ stack: CallStack) async -> () { let currency = balance.scopeInfo.currency transactions = await model.transactionsT(stack.push(), currency: currency) incompleteTransactions = WalletModel.incompleteTransactions(transactions) -// sectionID = UUID() } } @@ -78,13 +75,14 @@ extension BalancesSectionView: View { .accessibilityFont(.body) .multilineTextAlignment(.leading) } - BalancesNavigationLinksView(stack: stack.push(), - balance: balance, - amountToTransfer: $amountToTransfer, // does still have the wrong currency - summary: $summary, - completedTransactions: $completedTransactions, - reloadAllAction: reloadCompleted, - reloadOneAction: reloadOneAction) + BalancesNavigationLinksView(symLog: symLog, + stack: stack.push(), + balance: balance, + amountToTransfer: $amountToTransfer, // does still have the wrong currency + summary: $summary, + completedTransactions: $completedTransactions, + reloadAllAction: reloadCompleted, + reloadOneAction: reloadOneAction) if pendingTransactions.count > 0 { BalancesPendingRowView(symLog: symLog, stack: stack.push(), @@ -213,6 +211,7 @@ fileprivate struct BalancesPendingRowView: View { } // BalancesPendingRowView fileprivate struct BalancesNavigationLinksView: View { + let symLog: SymLogV? let stack: CallStack let balance: Balance // let sectionCount: Int diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift b/TalerWallet1/Views/Exchange/ManualWithdraw.swift @@ -37,8 +37,10 @@ struct ManualWithdraw: View { : String(localized: "Amount to withdraw:"), shortcutLabel: String(localized: "Withdraw", comment: "VoiceOver: Withdraw $50,$25,$10,$5 shortcut buttons")) let someCoins = SomeCoins(details: withdrawalAmountDetails) - QuiteSomeCoins(someCoins: someCoins, shouldShowFee: true, - currency: currency, amountEffective: withdrawalAmountDetails?.amountEffective) + QuiteSomeCoins(someCoins: someCoins, + shouldShowFee: true, // TODO: set to false if we never charge withdrawal fees + currency: currency, + amountEffective: withdrawalAmountDetails?.amountEffective) Text(exchange.exchangeBaseUrl.trimURL()) .multilineTextAlignment(.center) .accessibilityFont(.body) diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift b/TalerWallet1/Views/Peer2peer/RequestPayment.swift @@ -35,7 +35,8 @@ struct RequestPayment: View { shortcutLabel: String(localized: "Request", comment: "VoiceOver: Request $50,$25,$10,$5 shortcut buttons")) let someCoins = SomeCoins(details: peerPullCheck) - QuiteSomeCoins(someCoins: someCoins, shouldShowFee: true, + QuiteSomeCoins(someCoins: someCoins, + shouldShowFee: true, // always true since the requester pays fees currency: currency, amountEffective: peerPullCheck?.amountEffective) @@ -72,7 +73,7 @@ struct RequestPayment: View { if !amountToTransfer.isZero { do { let ppCheck = try await model.checkPeerPullCreditM(amountToTransfer, exchangeBaseUrl: nil) - peerPullCheck = ppCheck + peerPullCheck = ppCheck // redraw // TODO: set from exchange // agePicker.setAges(ages: peerPushCheck?.ageRestrictionOptions) } catch { // TODO: error diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift @@ -43,9 +43,11 @@ struct SendAmount: View { let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear #endif let currency = amountAvailable.currencyStr + let _ = symLog.log("currency: \(currency)") let currencyInfo = controller.info(for: currency, controller.currencyTicker) let navTitle = String(localized: "Send \(currency)", comment: "Send currency, Dialog Title") let available = amountAvailable.string(currencyInfo) + let _ = symLog.log("available: \(available)") let current = amountToTransfer.string(currencyInfo) let insufficientLabel = String(localized: "You don't have enough \(currency).") let insufficientLabel2 = String(localized: "but you only have \(available) to send.") diff --git a/TalerWallet1/Views/Settings/SettingsView.swift b/TalerWallet1/Views/Settings/SettingsView.swift @@ -99,6 +99,9 @@ struct SettingsView: View { SettingsItem(name: aboutStr, id1: "about", description: hideDescriptions ? nil : String(localized: "More info about this app...")) {} } +#if DEBUG + Text("https://bank.taler.grothoff.org/") +#endif // SettingsToggle(name: String(localized: "More Contrast"), value: $moreContrast, id1: "contrast", // description: hideDescriptions ? nil : String(localized: "If you don't like grey")) if controller.hapticCapability.supportsHaptics { diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -46,7 +46,7 @@ struct WithdrawURIView: View { baseURL: exchangeBaseUrl) let someCoins = SomeCoins(details: withdrawalAmountDetails) QuiteSomeCoins(someCoins: someCoins, - shouldShowFee: true, // TODO: set to false if we never charge withdrawal fees + shouldShowFee: true, // TODO: set to false if we never charge withdrawal fees currency: raw.currencyStr, amountEffective: effective) } diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift @@ -16,10 +16,10 @@ struct ManualDetailsV: View { let payto = paytoUris[0] let payURL = URL(string: payto) let iban = payURL?.iban ?? "unknown IBAN" - let amount = common.amountRaw.readableDescription + let amountStr = common.amountRaw.readableDescription // TODO: formatter Group { - Text(iconOnly ? "Transfer \(amount) to the Exchange." - : "You need to transfer \(amount) from your regular bank account to the Exchange.") + Text(iconOnly ? "Transfer \(amountStr) to the Exchange." + : "You need to transfer \(amountStr) from your regular bank account to the Exchange.") Text(iconOnly ? "Step 1: Copy+Paste this subject:" : "Step 1: Copy this code and paste it into the subject/purpose field in your banking app or bank website:") .multilineTextAlignment(.leading) @@ -55,8 +55,8 @@ struct ManualDetailsV: View { } .padding(.leading) .padding(.top, -8) .listRowSeparator(.hidden) - Text(iconOnly ? "Step 3: Transfer \(amount)." - : "Step 3: Finish the wire transfer of \(amount) in your banking app or website, then this withdrawal will proceed automatically.") + Text(iconOnly ? "Step 3: Transfer \(amountStr)." + : "Step 3: Finish the wire transfer of \(amountStr) in your banking app or website, then this withdrawal will proceed automatically.") .multilineTextAlignment(.leading) .listRowSeparator(.visible) Text(iconOnly ? "Or use this PayTo-Link:"