[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 02/03: Check that amount is valid
From: |
gnunet |
Subject: |
[taler-taler-ios] 02/03: Check that amount is valid |
Date: |
Wed, 05 Jul 2023 14:11:44 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit de01b1a18d40124e4601b110e754a5b5f3a4aca4
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Jul 5 14:10:03 2023 +0200
Check that amount is valid
---
TalerWallet1/Views/Exchange/ManualWithdraw.swift | 27 +++++++++++------------
TalerWallet1/Views/Peer2peer/RequestPayment.swift | 2 +-
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 50b7c38..9e350ab 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -31,18 +31,18 @@ struct ManualWithdraw: View {
// let agePicker = AgePicker(ageMenuList: $ageMenuList, selectedAge:
$selectedAge)
ScrollViewReader { scrollView in
- VStack {
- Text("from \(exchange.exchangeBaseUrl.trimURL())")
- .font(.title3)
- CurrencyInputView(currencyField: currencyField,
- title: String(localized: "Amount to withdraw:"))
+ VStack {
+ Text("from \(exchange.exchangeBaseUrl.trimURL())")
+ .font(.title3)
+ CurrencyInputView(currencyField: currencyField,
+ title: String(localized: "Amount to
withdraw:"))
- let someCoins = SomeCoins(details: withdrawalAmountDetails)
- QuiteSomeCoins(someCoins: someCoins, shouldShowFee: true,
- currency: currency, amountEffective:
withdrawalAmountDetails?.amountEffective)
+ let someCoins = SomeCoins(details: withdrawalAmountDetails)
+ QuiteSomeCoins(someCoins: someCoins, shouldShowFee: true,
+ currency: currency, amountEffective:
withdrawalAmountDetails?.amountEffective)
- if !someCoins.invalid {
- if !someCoins.tooMany {
+ let disabled = (centsToTransfer == 0) || someCoins.invalid ||
someCoins.tooMany
+ if !disabled {
// agePicker
if let tosAccepted = withdrawalAmountDetails?.tosAccepted {
@@ -67,10 +67,9 @@ struct ManualWithdraw: View {
}.buttonStyle(TalerButtonStyle(type: .prominent))
}
}
- } // tooMany
- } // invalid
- Spacer()
- }
+ } // disabled
+ Spacer()
+ }
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift
b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
index db40929..f0d5085 100644
--- a/TalerWallet1/Views/Peer2peer/RequestPayment.swift
+++ b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
@@ -38,7 +38,7 @@ struct RequestPayment: View {
currency: currency, amountEffective:
peerPullCheck?.amountEffective)
HStack {
- let disabled = centsToTransfer == 0
+ let disabled = (centsToTransfer == 0) || someCoins.invalid ||
someCoins.tooMany
NavigationLink(destination: LazyView {
PaymentPurpose(scopeInfo: scopeInfo,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.