commit 28cbe350dfc0dfd6f5eaabebf35db223c657a61c parent 41bd4a178e2a2602cc3ec31f48f7218761ca0eb2 Author: Marc Stibane <marc@taler.net> Date: Fri, 27 Nov 2026 08:29:47 +0100 cleanup Diffstat:
7 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift @@ -47,7 +47,7 @@ struct P2pPayURIView: View { effective: peerPullDebitResponse.amountEffective, isDone: false, scope: peerPullDebitResponse.scopeInfo, - summary: peerPullDebitResponse.contractTerms.summary) + header: peerPullDebitResponse.contractTerms.summary) let expiration = peerPullDebitResponse.contractTerms.purse_expiration ExpiresView(expiration: expiration) } @@ -113,7 +113,7 @@ struct PeerPullDebitView: View { let effective: Amount let isDone: Bool let scope: ScopeInfo? - let summary: String? + let header: String? @Environment(\.colorScheme) private var colorScheme @Environment(\.colorSchemeContrast) private var colorSchemeContrast @@ -139,6 +139,6 @@ struct PeerPullDebitView: View { incoming: false, baseURL: nil, txStateLcl: nil, - summary: summary) + header: header) } } diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift @@ -89,7 +89,7 @@ struct P2pReceiveURIView: View { effective: peerPushCreditResponse.amountEffective, isDone: false, scope: peerPushCreditResponse.scopeInfo, - summary: peerPushCreditResponse.contractTerms.summary) + header: peerPushCreditResponse.contractTerms.summary) ExpiresView(expiration: peerPushCreditResponse.contractTerms.purse_expiration) } .listStyle(myListStyle.style).anyView @@ -170,7 +170,7 @@ struct PeerPushCreditView: View { let effective: Amount let isDone: Bool let scope: ScopeInfo? - let summary: String? + let header: String? var body: some View { let fee = try! Amount.diff(raw, effective) @@ -190,7 +190,7 @@ struct PeerPushCreditView: View { incoming: true, baseURL: nil, txStateLcl: nil, - summary: summary) + header: header) } } // MARK: - diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentScan.swift b/TalerWallet1/Views/Sheets/Payment/PaymentScan.swift @@ -203,7 +203,7 @@ struct PaymentView2: View, Sendable { incoming: false, baseURL: baseURL, txStateLcl: nil, - summary: nil, // summary already shown in PaymentView above choices + header: nil, ) // TODO: payment: popup with all possible exchanges, check fees } else if let balanceDetails { // Insufficient @@ -228,7 +228,7 @@ struct PaymentView2: View, Sendable { incoming: false, baseURL: baseURL, txStateLcl: nil, - summary: nil, // summary already shown in PaymentView above choices + header: nil, ) } else { // TODO: Error - neither effective nor balanceDetails diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift @@ -89,7 +89,7 @@ struct WithdrawAcceptView: View { incoming: true, baseURL: exchange2.exchangeBaseUrl, txStateLcl: nil, // common.txState.major.localizedState - summary: nil) + header: nil) if let wireFee { if !wireFee.isZero { let currencyInfo = controller.info(for: scope, controller.currencyTicker) diff --git a/TalerWallet1/Views/Transactions/PaymentTransactionView.swift b/TalerWallet1/Views/Transactions/PaymentTransactionView.swift @@ -251,7 +251,7 @@ struct PaymentTransactionView: View { noFees: nil, // TODO: noFees feeIsNegative: false, large: true, - summary: details.info?.locSummary ?? EMPTYSTRING) + header: details.info?.locSummary) } // show finished payment } // body } // PaymentTransactionView diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsSection.swift b/TalerWallet1/Views/Transactions/ThreeAmountsSection.swift @@ -20,7 +20,7 @@ struct ThreeAmountsSheet: View { // should be in a separate file let noFees: Bool? // true if exchange charges no fees at all var feeIsNegative: Bool? // show fee with minus (or plus) sign, or no sign if nil let large: Bool // set to false for QR or IBAN - let summary: String? + let header: String? #if DEBUG @AppStorage("developerMode") var developerMode: Bool = true @@ -66,7 +66,7 @@ struct ThreeAmountsSheet: View { // should be in a separate file incoming: incoming, baseURL: baseURL, txStateLcl: txStateLcl, - summary: summary) + header: header) } } @@ -97,7 +97,7 @@ struct ThreeAmountsSection: View { let incoming: Bool let baseURL: String? let txStateLcl: String? // localizedState - let summary: String? + let header: String? @EnvironmentObject private var controller: Controller @Environment(\.colorScheme) private var colorScheme @@ -186,8 +186,7 @@ struct ThreeAmountsSection: View { } } } header: { - let header = scope?.url?.trimURL ?? scope?.currency ?? (summary != nil ? "Summary" : nil) - if let header { + if let header = header ?? scope?.url?.trimURL ?? scope?.currency { Text(header) .talerFont(.title3) .foregroundColor(WalletColors().secondary2(colorScheme, colorSchemeContrast)) @@ -229,7 +228,8 @@ struct ThreeAmounts_Previews: PreviewProvider { topTitle: "Withdrawal", baseURL: DEMOEXCHANGE, noFees: false, - large: 1==0, summary: nil) + large: false, + header: nil) .safeAreaInset(edge: .bottom) { Button(String("Preview")) {} .buttonStyle(TalerButtonStyle(type: .prominent)) diff --git a/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift b/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift @@ -120,7 +120,7 @@ struct TransactionTypeDetail: View { noFees: nil, // TODO: noFees feeIsNegative: true, large: false, - summary: nil) + header: nil) } @ViewBuilder func depositTransactionV(_ common: TransactionCommon, @@ -139,7 +139,7 @@ struct TransactionTypeDetail: View { noFees: nil, // TODO: noFees feeIsNegative: false, large: true, - summary: nil) + header: nil) } var body: some View { #if PRINT_CHANGES @@ -178,7 +178,7 @@ struct TransactionTypeDetail: View { noFees: nil, // TODO: noFees feeIsNegative: true, large: true, - summary: details.paymentInfo?.summary) + header: details.paymentInfo?.summary) } case .refresh(let refreshTransaction): Group { let labelColor = WalletColors().labelColor @@ -244,7 +244,7 @@ struct TransactionTypeDetail: View { effective: common.amountEffective, isDone: common.isDone, scope: scope, - summary: details.info.summary) + header: details.info.summary) .task { // tell caller which exchange to check for ToS-accepted tosBaseUrl = details.exchangeBaseUrl } @@ -259,7 +259,7 @@ struct TransactionTypeDetail: View { effective: common.amountEffective, isDone: common.isDone, scope: scope, - summary: details.info.summary) + header: details.info.summary) PeerPullDebitConfirm(stack: stack.push(), url: nil, transactionId: common.transactionId) } else { @@ -292,7 +292,7 @@ struct TransactionTypeDetail: View { noFees: nil, // TODO: noFees feeIsNegative: true, large: false, - summary: details.info.summary) + header: details.info.summary) } // else } // p2p @@ -307,8 +307,9 @@ struct TransactionTypeDetail: View { noFees: nil, feeIsNegative: nil, large: true, - summary: details.recoupReason) + header: details.recoupReason) } + case .denomLoss(let denomLossTransaction): Group { let details = denomLossTransaction.details // TODO: more details, details.lossEventType.rawValue ThreeAmountsSheet(stack: stack.push(), @@ -320,7 +321,7 @@ struct TransactionTypeDetail: View { noFees: nil, // TODO: noFees feeIsNegative: nil, large: true, - summary: details.lossEventType.rawValue) + header: details.lossEventType.rawValue) } } // switch } // Group