gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 06/69: withdraw-exchange


From: gnunet
Subject: [taler-taler-ios] 06/69: withdraw-exchange
Date: Fri, 19 Jan 2024 09:01:39 +0100

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 477a0e4b2bedc5b639821577fd1c355ded5ba237
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Dec 13 22:51:52 2023 +0100

    withdraw-exchange
---
 TalerWallet1/Views/Exchange/ManualWithdraw.swift | 27 ++++++++++++++----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift 
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index dafe44e..79f502c 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -6,7 +6,8 @@ import SwiftUI
 import taler_swift
 import SymLog
 
-// Will be called by the user tapping "Withdraw Coins" in the exchange list
+// Will be called by either the user tapping "Withdraw Coins" in the exchange 
list
+// or from WithdrawExchangeV after a withdraw-exchange QR was scanned
 struct ManualWithdraw: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
@@ -93,20 +94,24 @@ struct ManualWithdraw: View {
             LoadingView(url: nil, message: exchangeBaseUrl.trimURL())
         }
       } .task(id: amountToTransfer.value) { // re-run this whenever 
amountToTransfer changes
-          symLog.log("getExchangeByUrl(\(exchangeBaseUrl))")
-            do {
+            symLog.log("getExchangeByUrl(\(exchangeBaseUrl))")
+          if exchange == nil || exchange?.tosStatus != .accepted {
                 if let exc = await model.getExchangeByUrl(url: 
exchangeBaseUrl) {
                     exchange = exc
-                    if !amountToTransfer.isZero {
-                        let details = try await 
model.loadWithdrawalDetailsForAmountM(exchangeBaseUrl,
-                                                                               
       amount: amountToTransfer)
-                        withdrawalAmountDetails = details
+                } else {
+                    // TODO: Error "Can't get Exchange Info"
+                }
+            }
+            if !amountToTransfer.isZero {
+                do {
+                    let details = try await 
model.loadWithdrawalDetailsForAmountM(exchangeBaseUrl,
+                                                                           
amount: amountToTransfer)
+                    withdrawalAmountDetails = details
 //                    agePicker.setAges(ages: 
withdrawalAmountDetails?.ageRestrictionOptions)
-                    }
+                } catch {    // TODO: error
+                    symLog.log(error.localizedDescription)
+                    withdrawalAmountDetails = nil
                 }
-            } catch {    // TODO: error
-                symLog.log(error.localizedDescription)
-                withdrawalAmountDetails = nil
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]