taler-ios

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

commit f870f3449c334c597f267e8617ead80bd4f2d342
parent 709efe374bdb13064da2a718d19edeb44f4aaca8
Author: Marc Stibane <marc@taler.net>
Date:   Tue, 24 Feb 2026 08:18:45 +0100

"Status" of transactions shows more than just "Pending"

Diffstat:
MTalerWallet1/Model/Transaction.swift | 1+
MTalerWallet1/Views/Transactions/TransactionSummaryV.swift | 40++++++++++++++++------------------------
2 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/TalerWallet1/Model/Transaction.swift b/TalerWallet1/Model/Transaction.swift @@ -62,6 +62,7 @@ enum TransactionMinorState: String, Codable { case paidByOther = "paid-by-other" case completedByOtherWallet = "completed-by-other-wallet" + var localizedDbgState: String { self.rawValue } var localizedState: String? { switch self { case .unknown: return self.rawValue diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -122,6 +122,17 @@ struct TransactionSummaryV: View { } } + func localizedState() -> String { + let txState = talerTX.common.txState + if talerTX.isPending { + if let minorState = txState.minor { + return developerMode ? minorState.localizedDbgState + : minorState.localizedState ?? txState.major.localizedState + } + } + return txState.major.localizedState + } + var body: some View { #if PRINT_CHANGES let _ = Self._printChanges() @@ -161,35 +172,16 @@ struct TransactionSummaryV: View { .accessibilityLabel(a11yDate) .foregroundColor(WalletColors().secondary(colorScheme, colorSchemeContrast)) .id(topID) - let majorState = common.txState.major.localizedState - let minorState = common.txState.minor?.localizedState ?? nil - let state = developerMode ? talerTX.isPending ? minorState ?? majorState - : majorState - : majorState + let state = localizedState() let statusT = Text(state) .multilineTextAlignment(.trailing) let imageT = Text(common.type.icon()) .accessibilityHidden(true) - let prefixT = Text("Status:") - let vLayout = VStack(alignment: .leading, spacing: 0) { - HStack { - imageT - prefixT - } // Icon + State + HStack(alignment: .center, spacing: HSPACING) { + imageT + Spacer(minLength: 0) statusT - .frame(maxWidth: .infinity, alignment: .trailing) } - if #available(iOS 16.4, *) { - ViewThatFits(in: .horizontal) { - HStack(spacing: HSPACING) { - imageT - Spacer() - prefixT - statusT - } - vLayout - } - } else { vLayout } // view for iOS 15 if developerMode { if !jsonTransaction.isEmpty { CopyButton(textToCopy: jsonTransaction, title: "Copy JSON") @@ -338,7 +330,7 @@ struct TransactionSummaryV: View { let countPaytos = creditPaytoUris.count let account = validDetails[accountID] - Text("You need to verify having control over the bank account for the deposit.") + Text("You need to prove having control over the bank account for the deposit.") .bold() .fixedSize(horizontal: false, vertical: true) // wrap in scrollview .multilineTextAlignment(.leading) // otherwise