taler-ios

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

commit ce8cc1a88814c06825cd5f39f58a3cff37428bad
parent ac86750281e8df2886a61407452151367748bcaa
Author: Marc Stibane <marc@taler.net>
Date:   Thu, 18 Jul 2024 15:22:38 +0200

Pass in currencyInfo

Diffstat:
MTalerWallet1/Views/Balances/BalancesSectionView.swift | 1+
MTalerWallet1/Views/Peer2peer/SendAmount.swift | 8+++++---
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift b/TalerWallet1/Views/Balances/BalancesSectionView.swift @@ -275,6 +275,7 @@ fileprivate struct BalancesNavigationLinksView: View { HStack(spacing: 0) { NavigationLink(destination: LazyView { SendAmount(stack: stack.push(), + currencyInfo: currencyInfo, amountAvailable: balance.available, amountToTransfer: $amountToTransfer, // with correct currency summary: $summary, diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift @@ -13,6 +13,7 @@ import SymLog struct SendAmount: View { private let symLog = SymLogV(0) let stack: CallStack + let currencyInfo: CurrencyInfo? let amountAvailable: Amount // TODO: GetMaxPeerPushAmount @Binding var amountToTransfer: Amount @@ -189,20 +190,21 @@ fileprivate struct Preview_Content: View { } var body: some View { let amount = Amount(currency: LONGCURRENCY, cent: 1000) - let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) + let currencyInfo = CurrencyInfo.zero(LONGCURRENCY) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, masterPub: "masterPub", - scopeInfo: scopeInfo, + scopeInfo: currencyInfo.scope, paytoUris: [], tosStatus: .proposed, exchangeEntryStatus: .ephemeral, exchangeUpdateStatus: .ready, ageRestrictionOptions: []) SendAmount(stack: CallStack("Preview"), + currencyInfo: currencyInfo, amountAvailable: amount, amountToTransfer: $amountToPreview, summary: $summary, - scopeInfo: scopeInfo, + scopeInfo: currencyInfo.scope, cameraAction: checkCameraAvailable) } }