taler-ios

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

commit 87d0e0573b3c0c9045674a4b173a1572cf8e3e69
parent dafbcc394297613c24693786663151900ee704a0
Author: Marc Stibane <marc@taler.net>
Date:   Fri, 27 Nov 2026 20:02:03 +0100

Images (merchant)

Diffstat:
MTalerWallet1/Views/Sheets/Payment/ChoicesView.swift | 19+++++++++++++++----
MTalerWallet1/Views/Transactions/PaymentTransactionView.swift | 11++---------
2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/TalerWallet1/Views/Sheets/Payment/ChoicesView.swift b/TalerWallet1/Views/Sheets/Payment/ChoicesView.swift @@ -240,10 +240,21 @@ struct ProductsView: View, Sendable { ForEachWithIndex(array: products) { index, product in HStack { VStack(alignment: .leading) { - if let name = product.productName { - Text(name) - .bold() - .talerFont(.body) + HStack { + if let imageBase64 = product.image { + if let image = Image(imageBase64: imageBase64) { + image + .resizable() + .aspectRatio(contentMode: .fit) + .frame(maxHeight: 50) + .padding(.trailing, 8) + } + } + if let name = product.productName { + Text(name) + .bold() + .talerFont(.body) + } } Text(product.locDescription) .talerFont(.subheadline) diff --git a/TalerWallet1/Views/Transactions/PaymentTransactionView.swift b/TalerWallet1/Views/Transactions/PaymentTransactionView.swift @@ -16,8 +16,6 @@ struct MerchantHeader: View { @Environment(\.colorScheme) private var colorScheme @Environment(\.colorSchemeContrast) private var colorSchemeContrast - @State private var image: Image? = nil - func compactAddress(_ address: Location?) -> String? { if let address { var result: String = EMPTYSTRING @@ -45,8 +43,8 @@ struct MerchantHeader: View { if let terms { VStack(alignment: .leading) { HStack { - if terms.merchant.logo != nil { - if let image { + if let imageBase64 = terms.merchant.logo { + if let image = Image(imageBase64: imageBase64) { image .resizable() .aspectRatio(contentMode: .fit) @@ -72,11 +70,6 @@ struct MerchantHeader: View { } } .foregroundStyle(Color.primary) .padding(.bottom) - .task { - if let imageBase64 = terms.merchant.logo { - image = Image(imageBase64: imageBase64) - } - } // Text("Summary") // .talerFont(.title3) // .foregroundColor(WalletColors().secondary2(colorScheme, colorSchemeContrast))