taler-ios

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

commit 06abe762457f47aadb6b528e1da612cee72c970e
parent 086583d35316e1e01cc4031977d6ecfbfc1fbbdf
Author: Marc Stibane <marc@taler.net>
Date:   Sat, 27 Jul 2024 12:43:47 +0200

cleanup

Diffstat:
MTalerWallet1/Views/Peer2peer/RequestPayment.swift | 21---------------------
MTalerWallet1/Views/Sheets/Payment/PayTemplateV.swift | 2+-
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift | 7+++++--
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift | 2+-
4 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift b/TalerWallet1/Views/Peer2peer/RequestPayment.swift @@ -124,27 +124,6 @@ struct RequestPayment: View { .background(NavigationLink(destination: inputDestination, isActive: $buttonSelected) { EmptyView() }.frame(width: 0).opacity(0).hidden() ) // inputDestination - -// VStack(alignment: .trailing) { -// CurrencyInputView(amount: $amountToTransfer, -// available: nil, -// title: minimalistic ? String(localized: "Amount:") -// : String(localized: "Amount to request:"), -// shortcutAction: shortcutAction) -// .padding(.top) -// QuiteSomeCoins(currencyInfo: currencyInfo, -// currency: currency, -// coinData: coinData, -// shouldShowFee: true, // always true since the requester pays fees -// amountEffective: peerPullCheck?.amountEffective) -// NavigationLink(destination: inputDestination) { Text("Next") } -// .buttonStyle(TalerButtonStyle(type: .prominent, disabled: disabled)) -// .disabled(disabled) -// .background(NavigationLink(destination: shortcutDestination, isActive: $buttonSelected) -// { EmptyView() }.frame(width: 0).opacity(0).hidden() -// ) -// }.padding(.horizontal) - } // ScrollView .frame(maxWidth: .infinity, alignment: .leading) // .scrollBounceBehavior(.basedOnSize) needs iOS 16.4 diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift b/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift @@ -201,7 +201,7 @@ struct PayTemplateV: View { summaryIsEditable = contract.summary == nil let defaults = details.templateDetails.editableDefaults // might be nil, or its fields might be nil // TODO: let the user choose a currency from supportedCurrencies[] - let prepCurrency = contract.currency ?? defaults?.currency ?? + let prepCurrency = contract.currency ?? defaults?.currency ?? (details.supportedCurrencies.count > 0 ? details.supportedCurrencies[0] : UNKNOWN) let zeroAmount = Amount(currency: prepCurrency, cent: 0) diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift @@ -58,11 +58,14 @@ struct WithdrawAcceptView: View { currencyInfo: $currencyInfo, topTitle: String(localized: "Chosen amount to withdraw:"), topAbbrev: String(localized: "Withdraw:", comment: "Chosen amount to withdraw:"), - topAmount: raw, fee: fee, + topAmount: raw, + fee: fee, bottomTitle: String(localized: "Amount to obtain:"), bottomAbbrev: String(localized: "Obtain:", comment: "Amount to obtain:"), bottomAmount: effective, - large: false, pending: false, incoming: true, + large: false, + pending: false, + incoming: true, baseURL: exchange.exchangeBaseUrl, noFees: exchange.noFees, txStateLcl: nil, // common.txState.major.localizedState diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -68,7 +68,7 @@ struct WithdrawURIView: View { private func computeFeeWithdraw(_ amount: Amount) async -> ComputeFeeResult? { if let exchange { if let details = try? await model.getWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl, - amount: amount) { + amount: amount) { let fee = try? details.amountRaw - details.amountEffective let feeStr = fee?.readableDescription ?? "nix" symLog.log("Fee = \(feeStr)")