commit 7b221aa7d15f13a1070ebaadc42ad87105b8f5c5
parent 95c271732a69d134a1d1a0318a2f3311befcafd3
Author: Marc Stibane <marc@taler.net>
Date: Wed, 7 Oct 2026 14:01:27 +0200
remove nil param
Diffstat:
5 files changed, 8 insertions(+), 59 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
@@ -139,7 +139,6 @@ struct PeerPullDebitView: View {
incoming: false,
baseURL: nil,
txStateLcl: nil,
- summary: summary,
- products: nil)
+ summary: summary)
}
}
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -185,8 +185,7 @@ struct PeerPushCreditView: View {
incoming: true,
baseURL: nil,
txStateLcl: nil,
- summary: summary,
- products: nil)
+ summary: summary)
}
}
// 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 {
baseURL: baseURL,
txStateLcl: nil,
summary: nil, // summary already shown in PaymentView above choices
- products: products)
+ )
// TODO: payment: popup with all possible exchanges, check fees
} else if let balanceDetails { // Insufficient
if let localizedCause = balanceDetails.causeHint?.localizedCause(raw.currencyStr) {
@@ -228,7 +228,7 @@ struct PaymentView2: View, Sendable {
baseURL: baseURL,
txStateLcl: nil,
summary: nil, // summary already shown in PaymentView above choices
- products: products)
+ )
} else {
// TODO: Error - neither effective nor balanceDetails
Text("Error")
diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
@@ -95,8 +95,7 @@ struct WithdrawAcceptView: View {
incoming: true,
baseURL: exchange2.exchangeBaseUrl,
txStateLcl: nil, // common.txState.major.localizedState
- summary: nil,
- products: nil)
+ summary: nil)
if let wireFee {
if !wireFee.isZero {
let currencyInfo = controller.info(for: scope, controller.currencyTicker)
diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsSection.swift b/TalerWallet1/Views/Transactions/ThreeAmountsSection.swift
@@ -66,21 +66,12 @@ struct ThreeAmountsSheet: View { // should be in a separate file
incoming: incoming,
baseURL: baseURL,
txStateLcl: txStateLcl,
- summary: summary,
- products: nil)
+ summary: summary)
}
}
struct ProductImage: Codable, Hashable {
var imageBase64: String
- var description: String
- var price: Amount?
-
- init(_ image: String, _ desc: String, _ price: Amount?) {
- self.imageBase64 = image
- self.description = desc
- self.price = price
- }
var image: Image? {
Image(imageBase64)
@@ -107,59 +98,21 @@ struct ThreeAmountsSection: View {
let baseURL: String?
let txStateLcl: String? // localizedState
let summary: String?
- let products: [ProductSold]?
@EnvironmentObject private var controller: Controller
@Environment(\.colorScheme) private var colorScheme
@Environment(\.colorSchemeContrast) private var colorSchemeContrast
@AppStorage("minimalistic") var minimalistic: Bool = false
- @State private var productImages: [ProductImage] = []
@State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN)
@MainActor
private func viewDidLoad() async {
- var temp: [ProductImage] = []
- if let products {
- for product in products {
- if let imageBase64 = product.image {
- // TODO: choose price for scope
- let price = product.prices?.first ?? product.price
- let productImage = ProductImage(imageBase64, product.description, price)
- temp.append(productImage)
- }
- }
- }
- productImages = temp
if let scope {
currencyInfo = controller.info(for: scope) ?? CurrencyInfo.zero(UNKNOWN)
}
}
- @ViewBuilder
- var productImageSections: some View {
- ForEach(productImages, id: \.self) { productImage in
- if let image = productImage.image {
- Section {
- HStack {
- image.resizable()
- .scaledToFill()
- .frame(width: 64, height: 64)
- .accessibilityHidden(true)
- Text(productImage.description)
-// if let product_id = product.product_id {
-// Text(product_id)
-// }
- if let price = productImage.price {
- Spacer()
- AmountV(scope, price, isNegative: nil)
- }
- }.talerFont(.body)
- .accessibilityElement(children: .combine)
- }
- }
- }
- }
var body: some View {
let currency = currencyInfo.currency
@@ -167,14 +120,13 @@ struct ThreeAmountsSection: View {
let bottomColor = pendingDialog ? WalletColors().pendingColor(incoming)
: WalletColors().transactionColor(incoming)
let hasNoFees = noFees ?? false
- productImageSections
Section {
if let summary {
- if productImages.isEmpty { // otherwise we already have rendered the images
+// if productImages.isEmpty { // otherwise we already have rendered the images
Text(summary) // and thus don't need a summary
.talerFont(.title3)
.padding(.bottom)
- }
+// }
}
if currency != "UNKNOWN" {