taler-ios

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

commit 7f77b87dab3f67e071df8a0052e892a2b161a99b
parent 7152b6eec54222b5b98c880bcdfb1bc537a53ae6
Author: Marc Stibane <marc@taler.net>
Date:   Tue, 26 Nov 2024 19:22:23 +0100

common.scopes.first

Diffstat:
MTalerWallet1/Views/Actions/Banking/ManualWithdraw.swift | 2+-
MTalerWallet1/Views/Actions/Banking/ManualWithdrawDone.swift | 6+++---
MTalerWallet1/Views/Actions/Peer2peer/P2PReadyV.swift | 2+-
MTalerWallet1/Views/Sheets/Payment/PaymentDone.swift | 4++--
MTalerWallet1/Views/Sheets/Payment/PaymentView.swift | 2+-
MTalerWallet1/Views/Sheets/Refund/RefundURIView.swift | 23+++++++++++------------
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift | 4++--
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift | 2+-
MTalerWallet1/Views/Transactions/TransactionSummaryV.swift | 3++-
MTalerWallet1/Views/Transactions/TransactionsListView.swift | 2+-
10 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/TalerWallet1/Views/Actions/Banking/ManualWithdraw.swift b/TalerWallet1/Views/Actions/Banking/ManualWithdraw.swift @@ -201,7 +201,7 @@ struct ManualWithdrawContent: View { // : selectedAge // let _ = print(selectedAge, restrictAge) let destination = ManualWithdrawDone(stack: stack.push(), - scope: detailsForAmount.scopeInfo, +// scope: detailsForAmount.scopeInfo, baseURL: baseURL, amountToTransfer: amountToTransfer) // restrictAge: restrictAge) diff --git a/TalerWallet1/Views/Actions/Banking/ManualWithdrawDone.swift b/TalerWallet1/Views/Actions/Banking/ManualWithdrawDone.swift @@ -12,7 +12,7 @@ import SymLog struct ManualWithdrawDone: View { private let symLog = SymLogV(0) let stack: CallStack - let scope: ScopeInfo // TODO: use data from tx itself +// let scope: ScopeInfo // TODO: use data from tx itself let baseURL: String let amountToTransfer: Amount @@ -44,7 +44,7 @@ struct ManualWithdrawDone: View { Group { if let transactionId { TransactionSummaryV(stack: stack.push(), - scope: scope, // TODO: use data from tx itself +// scope: scope, // TODO: use data from tx itself transactionId: transactionId, outTransaction: $noTransaction, navTitle: navTitle, @@ -93,7 +93,7 @@ fileprivate struct ManualWithdrawDone_Previews: PreviewProvider { exchangeUpdateStatus: .initial, ageRestrictionOptions: []) ManualWithdrawDone(stack: CallStack("Preview"), - scope: scopeInfo, +// scope: scopeInfo, baseURL: DEMOEXCHANGE, amountToTransfer: amountToTransfer) } diff --git a/TalerWallet1/Views/Actions/Peer2peer/P2PReadyV.swift b/TalerWallet1/Views/Actions/Peer2peer/P2PReadyV.swift @@ -71,7 +71,7 @@ struct P2PReadyV: View { Group { if let transactionId { TransactionSummaryV(stack: stack.push(), - scope: scope, +// scope: scope, transactionId: transactionId, outTransaction: $noTransaction, navTitle: navTitle, diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift b/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift @@ -11,7 +11,7 @@ import SymLog struct PaymentDone: View { private let symLog = SymLogV(0) let stack: CallStack - let scope: ScopeInfo? +// let scope: ScopeInfo? let transactionId: String @EnvironmentObject private var controller: Controller @@ -39,7 +39,7 @@ struct PaymentDone: View { if paymentDone { let navTitle = String(localized: "Paid", comment: "Title, short") TransactionSummaryV(stack: stack.push(), - scope: scope, +// scope: scope, transactionId: transactionId, outTransaction: $noTransaction, navTitle: navTitle, diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -220,7 +220,7 @@ struct PaymentView: View, Sendable { if let effective { VStack { let destination = PaymentDone(stack: stack.push(), - scope: firstScope, // TODO: let user choose which currency +// scope: firstScope, // TODO: let user choose which currency transactionId: preparePayResult.transactionId) NavigationLink(destination: destination) { let formatted = raw.formatted(currencyInfo, isNegative: false) diff --git a/TalerWallet1/Views/Sheets/Refund/RefundURIView.swift b/TalerWallet1/Views/Sheets/Refund/RefundURIView.swift @@ -20,9 +20,8 @@ struct RefundURIView: View { // let navTitle = String(localized: "Refund", comment:"receive refund") @State var refundTransactionId: String? = nil - @State var transaction: Transaction? - @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) - +// @State var transaction: Transaction? +// @State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN) @State private var noTransaction: Transaction? = nil @MainActor @@ -35,14 +34,14 @@ struct RefundURIView: View { } var body: some View { - if let refundTransactionId, let transaction { - let common = transaction.common - let scope = common.scopes[0] // TODO: tx could span multiple scopes - let raw = common.amountRaw - let currency = raw.currencyStr + if let refundTransactionId { //, let transaction { +// let common = transaction.common +// let scope = common.scopes[0] // TODO: tx could span multiple scopes +// let raw = common.amountRaw +// let currency = raw.currencyStr TransactionSummaryV(stack: stack.push(), - scope: scope, +// scope: scope, transactionId: refundTransactionId, outTransaction: $noTransaction, navTitle: nil, // navTitle, @@ -57,9 +56,9 @@ struct RefundURIView: View { .buttonStyle(TalerButtonStyle(type: .prominent)) .padding(.horizontal) } - .task(id: controller.currencyTicker) { - currencyInfo = controller.info2(for: currency, controller.currencyTicker) - } +// .task(id: controller.currencyTicker) { +// currencyInfo = controller.info2(for: currency, controller.currencyTicker) +// } } else { LoadingView(scopeInfo: nil, message: url.host) .task { await viewDidLoad() } diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift @@ -12,7 +12,7 @@ import SymLog struct WithdrawAcceptDone: View { private let symLog = SymLogV(0) let stack: CallStack - let scope: ScopeInfo +// let scope: ScopeInfo let exchangeBaseUrl: String? let url: URL let amountToTransfer: Amount? @@ -48,7 +48,7 @@ struct WithdrawAcceptDone: View { #endif if let transactionId { TransactionSummaryV(stack: stack.push(), - scope: scope, +// scope: scope, transactionId: transactionId, outTransaction: $transaction, navTitle: navTitle, diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift @@ -103,7 +103,7 @@ struct WithdrawAcceptView: View { .safeAreaInset(edge: .bottom) { if tosAccepted { let destination = WithdrawAcceptDone(stack: stack.push(), - scope: scope, +// scope: scope, exchangeBaseUrl: exchange.exchangeBaseUrl, url: url, amountToTransfer: amountToTransfer) diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -28,7 +28,7 @@ extension Transaction { // for Dummys struct TransactionSummaryV: View { private let symLog = SymLogV(0) let stack: CallStack - let scope: ScopeInfo? +// let scope: ScopeInfo? let transactionId: String @Binding var outTransaction: Transaction? let navTitle: String? @@ -122,6 +122,7 @@ struct TransactionSummaryV: View { #endif let common = transaction.common if common.type != .dummy { + let scope = common.scopes.first // might be nil if scopes == [] let pending = transaction.isPending let locale = TalerDater.shared.locale let (dateString, date) = TalerDater.dateString(common.timestamp, minimalistic) diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift b/TalerWallet1/Views/Transactions/TransactionsListView.swift @@ -110,7 +110,7 @@ struct TransactionsArraySliceV: View { ForEach(transactions, id: \.self) { transaction in let destination = TransactionSummaryV(stack: stack.push(), - scope: scope, +// scope: scope, transactionId: transaction.id, outTransaction: $noTransaction, navTitle: nil,