gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 29/40: Warning if scanning outgoing from request view


From: gnunet
Subject: [taler-taler-ios] 29/40: Warning if scanning outgoing from request view
Date: Mon, 22 Jul 2024 22:46:22 +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 6e6f68033a8e428798d6f9e7e46354166862e3e9
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Jul 20 07:02:07 2024 +0200

    Warning if scanning outgoing from request view
---
 TalerWallet1/Views/Sheets/URLSheet.swift | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift 
b/TalerWallet1/Views/Sheets/URLSheet.swift
index 9cb70f1..d6fe3cf 100644
--- a/TalerWallet1/Views/Sheets/URLSheet.swift
+++ b/TalerWallet1/Views/Sheets/URLSheet.swift
@@ -15,15 +15,19 @@ struct URLSheet: View {
     let navTitle = String(localized: "Checking Link")
     var urlToOpen: URL
 
+    @AppStorage("shouldShowWarning") var shouldShowWarning: Bool = true
     @EnvironmentObject private var controller: Controller
     @State private var amountToTransfer = Amount.zero(currency: EMPTYSTRING)
     @State private var summary = EMPTYSTRING
+    @State private var showAlert: Bool = false
+    @State private var urlCommand: UrlCommand = .unknown
+
     var body: some View {
 #if PRINT_CHANGES
         let _ = Self._printChanges()
         let _ = symLog.vlog()       // just to get the # to compare it with 
.onAppear & onDisappear
 #endif
-        let urlCommand = controller.openURL(urlToOpen, stack: stack.push())
+        let warning = String(localized: "It seems you wanted to request money 
- but this transaction will let you pay...")
 
         Group {
             switch urlCommand {
@@ -54,6 +58,24 @@ struct URLSheet: View {
                     .navigationTitle(navTitle)
             }
         }
+        .task {
+            let incomingExpected = controller.frontendState == 1
+            let command = controller.openURL(urlToOpen, stack: stack.push())
+            if incomingExpected && command.isOutgoing {
+                showAlert = true
+            }
+            urlCommand = command
+        }
+        .alert(warning, isPresented: $showAlert, actions: {
+            Button("Cancel", role: .cancel) {
+                showAlert = false
+                dismissTop(stack.push())
+            }
+            Button("OK") {
+                showAlert = false
+            }
+          }, message: { Text("\nWarnings can be switched off in Settings") }
+        )
     }
 }
 // MARK: -

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