taler-ios

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

commit 57feb2d31f8ae742b47d28de0bde485b33603653
parent ca9d8da18a60d5f31d191798994b01c908cb87c2
Author: Marc Stibane <marc@taler.net>
Date:   Tue, 17 Jun 2025 06:10:28 +0200

Fix #10093

Diffstat:
MTalerWallet1/Views/HelperViews/QRCodeDetailView.swift | 8+++++---
MTalerWallet1/Views/Transactions/TransactionSummaryV.swift | 3++-
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift @@ -14,7 +14,7 @@ struct QRCodeDetailView: View { let talerCopyShare: String let incoming: Bool let amount: Amount - let scope: ScopeInfo + let scope: ScopeInfo? @EnvironmentObject private var controller: Controller @AppStorage("minimalistic") var minimalistic: Bool = false @@ -22,13 +22,15 @@ struct QRCodeDetailView: View { @State private var currencyInfo: CurrencyInfo? private func currencyTickerChanged() async { - currencyInfo = controller.info(for: scope) + if let scope { + currencyInfo = controller.info(for: scope) + } } private func amountStr(_ currencyInfo : CurrencyInfo?) -> (String, String) { let amountFormatted: (String, String) let readable = amount.readableDescription - let myCurrencyInfo = currencyInfo ?? controller.info(for: scope) + let myCurrencyInfo = currencyInfo ?? (scope != nil ? controller.info(for: scope!) : nil) if let myCurrencyInfo { amountFormatted = amount.formatted(myCurrencyInfo, isNegative: false, useISO: false, a11yDecSep: nil) diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -687,7 +687,8 @@ struct TransactionSummaryV: View { talerCopyShare: talerURI, incoming: transaction.isP2pIncoming, amount: transaction.common.amountRaw, - scope: transaction.common.scopes[0]) + scope: transaction.common.scopes.first) + // scopes shouldn't (- but might) be nil! } } } else if keys.contains(EXCHANGEBASEURL) {