taler-ios

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

commit b0beab56071408c152e660d0707dea3fcd3237b1
parent d45acb380ea57321ed9dccfc9f17a8b347d563c4
Author: Marc Stibane <marc@taler.net>
Date:   Sat, 20 Jul 2024 05:56:39 +0200

Pass in currencyInfo

Diffstat:
MTalerWallet1/Views/Balances/BalancesPendingRowV.swift | 18++++++++++--------
MTalerWallet1/Views/Balances/PendingRowView.swift | 7+++++--
2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalancesPendingRowV.swift b/TalerWallet1/Views/Balances/BalancesPendingRowV.swift @@ -30,16 +30,18 @@ struct BalancesPendingRowV: View { VStack(spacing: 6) { if hasIncoming { - PendingRowView(amount: pendingIncoming, - incoming: true, - shouldConfirm: shouldConfirm, - needsKYC: needsKYCin) + PendingRowView(currencyInfo: currencyInfo, + amount: pendingIncoming, + incoming: true, + shouldConfirm: shouldConfirm, + needsKYC: needsKYCin) } if hasOutgoing { - PendingRowView(amount: pendingOutgoing, - incoming: false, - shouldConfirm: false, - needsKYC: needsKYCout) + PendingRowView(currencyInfo: currencyInfo, + amount: pendingOutgoing, + incoming: false, + shouldConfirm: false, + needsKYC: needsKYCout) } if !hasIncoming && !hasOutgoing { // should never happen - but DOES when wallet-core doesn't report P2P as pendingIncoming/pendingOutgoing diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift b/TalerWallet1/Views/Balances/PendingRowView.swift @@ -10,6 +10,7 @@ import taler_swift /// This view shows a pending transaction row in a currency section struct PendingRowView: View { + let currencyInfo: CurrencyInfo let amount: Amount let incoming: Bool let shouldConfirm: Bool @@ -75,8 +76,10 @@ fileprivate struct Preview_Content: View { let test = Amount(currency: TESTCURRENCY, cent: 123) let demo = Amount(currency: DEMOCURRENCY, cent: 123456) List { - PendingRowView(amount: test, incoming: true, shouldConfirm: true, needsKYC: false) - PendingRowView(amount: demo, incoming: false, shouldConfirm: false, needsKYC: true) + PendingRowView(currencyInfo: CurrencyInfo.zero(TESTCURRENCY), + amount: test, incoming: true, shouldConfirm: true, needsKYC: false) + PendingRowView(currencyInfo: CurrencyInfo.zero(DEMOCURRENCY), + amount: demo, incoming: false, shouldConfirm: false, needsKYC: true) } } }