commit 4d66a94d76273fb2ed6547a361b8f20617e12a1d parent 95f7ff618f032b7fece1564b5c0d15af22d0a458 Author: Marc Stibane <marc@taler.net> Date: Fri, 17 Nov 2023 16:55:06 +0100 Bugfix: set currency in buttonAction Diffstat:
| M | TalerWallet1/Views/Balances/BalancesSectionView.swift | | | 12 | +++++------- |
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift b/TalerWallet1/Views/Balances/BalancesSectionView.swift @@ -225,6 +225,10 @@ fileprivate struct BalancesNavigationLinksView: View { @State private var buttonSelected: Int? = nil func selectAndUpdate(_ button: Int) { + let currency = balance.scopeInfo.currency + amountToTransfer.setCurrency(currency) + symLog?.log("balance.scopeInfo.currency: \(currency)") + buttonSelected = button // will trigger NavigationLink // while navigation animation runs, contact Exchange to update Fees // Task { // runs on MainActor @@ -236,14 +240,8 @@ fileprivate struct BalancesNavigationLinksView: View { // } } - func setCurrency() -> String { - let currency = balance.scopeInfo.currency - amountToTransfer.setCurrency(currency) - return currency - } - var body: some View { - let currency = setCurrency() // update currency in amountToTransfer + let currency = balance.scopeInfo.currency HStack(spacing: 0) { NavigationLink(destination: LazyView { SendAmount(stack: stack.push(),