gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 06/35: no need to call urlCommand async


From: gnunet
Subject: [taler-taler-ios] 06/35: no need to call urlCommand async
Date: Thu, 27 Jul 2023 09:09:39 +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 4a8e217b08d7e9b735ffb657d2660556bc945923
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Jul 10 13:28:49 2023 +0200

    no need to call urlCommand async
---
 TalerWallet1/Views/Sheets/URLSheet.swift | 43 +++++++++++++-------------------
 1 file changed, 17 insertions(+), 26 deletions(-)

diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift 
b/TalerWallet1/Views/Sheets/URLSheet.swift
index 723480f..91fa824 100644
--- a/TalerWallet1/Views/Sheets/URLSheet.swift
+++ b/TalerWallet1/Views/Sheets/URLSheet.swift
@@ -11,36 +11,27 @@ struct URLSheet: View {
     var urlToOpen: URL
     @EnvironmentObject private var controller: Controller
 
-    @State private var urlCommand: UrlCommand? = nil
-
     var body: some View {
+        let urlCommand = controller.openURL(urlToOpen)
+
         Group {
-            if let urlCommand {
-                switch urlCommand {
-                    case .withdraw:
-                        WithdrawURIView(url: urlToOpen)
-                    case .pay:
-                        PaymentURIView(url: urlToOpen)
-                    case .payPull:
-                        P2pPayURIView(url: urlToOpen)
-                    case .payPush:
-                        P2pReceiveURIView(url: urlToOpen)
-                    case .unknown:
+            switch urlCommand {
+                case .withdraw:
+                    WithdrawURIView(url: urlToOpen)
+                case .pay:
+                    PaymentURIView(url: urlToOpen)
+                case .payPull:
+                    P2pPayURIView(url: urlToOpen)
+                case .payPush:
+                    P2pReceiveURIView(url: urlToOpen)
+                case .unknown:        // Error view
+                    VStack {
                         Text("unknown command")
-                }
-            } else {
-                VStack {        // Error view
-                    Spacer()
-                    Text(controller.messageForSheet ?? 
urlToOpen.absoluteString)
-                        .font(.title)
-                    Spacer()
-                    Spacer()
-                }
-                .navigationTitle(navTitle)
+                            .font(.title)
+                        Text(controller.messageForSheet ?? 
urlToOpen.absoluteString)
+                    }
+                    .navigationTitle(navTitle)
             }
-        }.task {
-            symLog.log(urlToOpen)
-            urlCommand = controller.openURL(urlToOpen)
         }
     }
 }

-- 
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]