taler-ios

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

commit 97ca40f5b60bb5bbdb4d107d2247d73a6fd4119a
parent a2f80815c7baf4dcada9b1b68d913978431f36b7
Author: Marc Stibane <marc@taler.net>
Date:   Tue, 25 Jul 2023 16:39:39 +0200

small fixes

Diffstat:
MTalerWallet1/Views/Exchange/ManualWithdrawDone.swift | 3++-
MTalerWallet1/Views/HelperViews/CurrencyInputView.swift | 2+-
MTalerWallet1/Views/Peer2peer/SendAmount.swift | 46++++++++++++++++++++++------------------------
3 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift b/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift @@ -33,7 +33,8 @@ struct ManualWithdrawDone: View { TransactionDetailView(transactionId: transactionId, reloadAction: reloadOneAction, doneAction: ViewState.shared.popToRootView) - .navigationBarBackButtonHidden(true) // exit only by Done-Button + .navigationBarBackButtonHidden(true) + .interactiveDismissDisabled() // can only use "Done" button to dismiss .navigationTitle(navTitle) } else { WithdrawProgressView(message: exchange.exchangeBaseUrl.trimURL()) diff --git a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift @@ -16,7 +16,7 @@ struct CurrencyInputView: View { var body: some View { VStack (alignment: .leading) { Text(title) - .padding(.top) +// .padding(.top) .font(.title3) currencyField .frame(maxWidth: .infinity, alignment: .trailing) diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift @@ -41,18 +41,17 @@ struct SendAmount: View { let fee = fee(ppCheck: peerPushCheck) // ScrollViewReader { scrollView in - VStack { - let available = amountAvailable.readableDescription - Text("Available: \(available)") - .font(.title3) - CurrencyInputView(currencyField: currencyField, - title: String(localized: "Amount to send:")) + VStack(alignment: .trailing) { + let available = amountAvailable.readableDescription + Text("Available: \(available)") + .font(.title3) + .padding(.bottom, 2) + CurrencyInputView(currencyField: currencyField, + title: String(localized: "Amount to send:")) + Text("+ \(fee) payment fee") + .foregroundColor(.red) + .padding(4) - Text("+ \(fee) payment fee") - .foregroundColor(.red) - .padding(4) - - HStack { let disabled = centsToTransfer == 0 // TODO: check amountAvailable NavigationLink(destination: LazyView { @@ -61,15 +60,12 @@ struct SendAmount: View { fee: fee, summary: $summary, expireDays: $expireDays) -// { deactivateAction() } }) { Text("To another wallet") - } - .buttonStyle(TalerButtonStyle(type: .prominent)) - .disabled(disabled) + } .buttonStyle(TalerButtonStyle(type: .prominent)) + .disabled(disabled) + Spacer() } - Spacer() - } // } .frame(maxWidth: .infinity, alignment: .leading) .padding(.horizontal) @@ -83,15 +79,17 @@ struct SendAmount: View { symLog.log("❗️Yikes SendAmount onDisappear") } .task(id: centsToTransfer) { - let amount = Amount.amountFromCents(currency, centsToTransfer) - do { - let ppCheck = try await model.checkPeerPushDebitM(amount) - peerPushCheck = ppCheck + if centsToTransfer > 0 { + let amount = Amount.amountFromCents(currency, centsToTransfer) + do { + let ppCheck = try await model.checkPeerPushDebitM(amount) + peerPushCheck = ppCheck // TODO: set from exchange // agePicker.setAges(ages: peerPushCheck?.ageRestrictionOptions) - } catch { // TODO: error - symLog.log(error.localizedDescription) - peerPushCheck = nil + } catch { // TODO: error + symLog.log(error.localizedDescription) + peerPushCheck = nil + } } } }