taler-ios

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

commit 0c848cac52bec2b30114b7339de7d69026946b2b
parent 2b7249b1b774d3c7d47535f40378e1303d1cdb76
Author: Marc Stibane <marc@taler.net>
Date:   Mon, 27 Jul 2026 09:54:58 +0200

txId for updating logo

Diffstat:
MTalerWallet1/Controllers/Controller.swift | 4++--
MTalerWallet1/Model/Model+Payment.swift | 1+
MTalerWallet1/Views/Transactions/TransactionSummaryList.swift | 3++-
MTalerWallet1/Views/Transactions/TransactionTypeDetail.swift | 4+++-
4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Controllers/Controller.swift b/TalerWallet1/Controllers/Controller.swift @@ -143,7 +143,7 @@ class Controller: ObservableObject { @Published var oimSheetActive: Bool = false @Published var diagnosticModeEnabled: Bool = false @Published var talerURI: URL? = nil - @Published var choicesForPayment: ChoicesForPayment? = nil + @Published var choicesTuple: ChoicesTuple = (nil, nil) @AppStorage("useHaptics") var useHaptics: Bool = true // extension mustn't define this, so it must be here @AppStorage("playSounds") var playSounds: Bool = false @@ -399,7 +399,7 @@ class Controller: ObservableObject { if isLoadingChoices != txId { isLoadingChoices = txId if let choiceResponse = try? await model.getChoicesForPayment(txId) { - choicesForPayment = choiceResponse + choicesTuple = (txId, choiceResponse) isLoadingChoices = nil return true } else { diff --git a/TalerWallet1/Model/Model+Payment.swift b/TalerWallet1/Model/Model+Payment.swift @@ -370,6 +370,7 @@ struct ChoiceSelectionDetail: Codable, Hashable, Sendable { } typealias ChoiceTriple = (ChoiceSelectionDetail, ContractChoice, Int) +typealias ChoicesTuple = (String?, ChoicesForPayment?) // txID struct ChoicesForPayment: Codable { var choices: [ChoiceSelectionDetail] diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryList.swift b/TalerWallet1/Views/Transactions/TransactionSummaryList.swift @@ -151,7 +151,8 @@ struct PaymentTransactionView: View { if common.isDialog { // show payment confirmation dialog MerchantHeader(terms: details.contractTerms) - if let choicesForPayment = controller.choicesForPayment { + let choicesTuple = controller.choicesTuple + if let txId = choicesTuple.0, let choicesForPayment = choicesTuple.1 { if let (choices, showHeader) = choicesForPayment.choiceTriple() { let hasAutomatic = choicesForPayment.automaticExecution ?? false let automaticIndex = hasAutomatic ? choicesForPayment.automaticExecutableIndex : nil diff --git a/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift b/TalerWallet1/Views/Transactions/TransactionTypeDetail.swift @@ -125,7 +125,9 @@ struct TransactionTypeDetail: View { .task(id: common.txState.hashValue) { let state = common.txState if common.isDialog { - if controller.choicesForPayment == nil { + let choicesTuple = controller.choicesTuple + let choicesForPayment = choicesTuple.1 + if choicesTuple.0 != common.transactionId || choicesForPayment == nil { symLog.log("❗️❗️ task: \(common.txState)") await controller.loadChoicesForPayment(stack.push(),model, txId: common.transactionId)