commit 846c8212f95e617d081671f5b8717f41958b7e47
parent f941fe2a945fbed3e8cfb7675bcb229c0d8ba0dc
Author: Marc Stibane <marc@taler.net>
Date: Tue, 24 Oct 2023 16:45:14 +0200
Only call DetailsForAmount if non-zero
Diffstat:
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -81,13 +81,15 @@ struct ManualWithdraw: View {
DebugViewC.shared.setViewID(VIEW_WITHDRAWAL, stack: stack.push())
}
.task(id: centsToTransfer) { // re-run this whenever centsToTransfer changes
- let amount = Amount.amountFromCents(currency, centsToTransfer)
- do {
- withdrawalAmountDetails = try await model.loadWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl, amount: amount)
-// agePicker.setAges(ages: withdrawalAmountDetails?.ageRestrictionOptions)
- } catch { // TODO: error
- symLog.log(error.localizedDescription)
- withdrawalAmountDetails = nil
+ if centsToTransfer > 0 {
+ let amount = Amount.amountFromCents(currency, centsToTransfer)
+ do {
+ withdrawalAmountDetails = try await model.loadWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl, amount: amount)
+// agePicker.setAges(ages: withdrawalAmountDetails?.ageRestrictionOptions)
+ } catch { // TODO: error
+ symLog.log(error.localizedDescription)
+ withdrawalAmountDetails = nil
+ }
}
}
}