commit 62852d40ada56e5163abdd570ae343e8e9873151
parent 0de2833947dd573b94ff2f8895c6ac0081fd3026
Author: Marc Stibane <marc@taler.net>
Date: Tue, 24 Feb 2026 08:11:26 +0100
move func to where it belongs
Diffstat:
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/TalerWallet1/Model/Transaction.swift b/TalerWallet1/Model/Transaction.swift
@@ -779,6 +779,18 @@ enum TalerTransaction: Decodable, Hashable, Identifiable, Sendable {
}
}
+ func amount() -> Amount {
+ switch self {
+ case .refresh(let refreshTransaction):
+ let details = refreshTransaction.details
+ return details.refreshInputAmount
+ default:
+ let eff = common.amountEffective
+ if !eff.isZero { return eff }
+ return common.amountRaw
+ }
+ }
+
func detailsToShow() -> Dictionary<String, String> {
var result: [String:String] = [:]
switch self {
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -81,19 +81,6 @@ struct TransactionRowView: View {
}
}
- func amount() -> Amount {
- switch transaction {
- case .refresh(let refreshTransaction):
- let details = refreshTransaction.details
- return details.refreshInputAmount
- default:
- let common = transaction.common
- let eff = common.amountEffective
- if !eff.isZero { return eff }
- return common.amountRaw
- }
- }
-
var body: some View {
#if DEBUG
// let _ = Self._printChanges()
@@ -129,9 +116,10 @@ struct TransactionRowView: View {
done: done, incoming: incoming,
shouldConfirm: shouldConfirm && pending,
needsKYC: needsKYC && pending)
- let amountV = AmountV(scope, amount(), isNegative: isZero ? nil : !incoming,
- strikethrough: !donePendingDialog)
- .foregroundColor(for2Color)
+ let amountV = AmountV(scope, transaction.amount(),
+ isNegative: isZero ? nil : !incoming,
+ strikethrough: !donePendingDialog)
+ .foregroundColor(for2Color)
let topA11y = topString(forA11y: true)!
let topString = topString()
let strikeColor = donePendingDialog ? nil : WalletColors().negative