[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.
- [taler-taler-ios] 32/40: BalanceRowView -> SendRequestV, (continued)
- [taler-taler-ios] 32/40: BalanceRowView -> SendRequestV, gnunet, 2024/07/22
- [taler-taler-ios] 35/40: cleanup, gnunet, 2024/07/22
- [taler-taler-ios] 09/40: Use currencyName for header, gnunet, 2024/07/22
- [taler-taler-ios] 37/40: shouldShowWarning, gnunet, 2024/07/22
- [taler-taler-ios] 27/40: frontendState, gnunet, 2024/07/22
- [taler-taler-ios] 30/40: ThreeAmountsSection, gnunet, 2024/07/22
- [taler-taler-ios] 33/40: BalanceRowView -> SendRequestV, gnunet, 2024/07/22
- [taler-taler-ios] 23/40: Pass in currencyInfo, gnunet, 2024/07/22
- [taler-taler-ios] 11/40: cleanup, gnunet, 2024/07/22
- [taler-taler-ios] 24/40: BalancesPendingRowV, gnunet, 2024/07/22
- [taler-taler-ios] 29/40: Warning if scanning outgoing from request view,
gnunet <=
- [taler-taler-ios] 07/40: checkInfo, gnunet, 2024/07/22
- [taler-taler-ios] 18/40: Use currencyName for a11y, gnunet, 2024/07/22
- [taler-taler-ios] 08/40: Added name & symbol, gnunet, 2024/07/22
- [taler-taler-ios] 14/40: no message, gnunet, 2024/07/22
- [taler-taler-ios] 31/40: BalanceCellV, gnunet, 2024/07/22
- [taler-taler-ios] 17/40: Pass in currencyInfo, gnunet, 2024/07/22
- [taler-taler-ios] 10/40: Use currencyName for buttons, gnunet, 2024/07/22