commit 4553bd29281d6ee974128c96aca9423e5d555b48
parent 1a4a13e65ae6366a2b3defe6b49f9c0e6a659d1b
Author: Marc Stibane <marc@taler.net>
Date: Fri, 4 Jul 2025 09:45:27 +0200
NFC handling
Diffstat:
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/TalerWallet1/Helper/TagEmulation.swift b/TalerWallet1/Helper/TagEmulation.swift
@@ -114,9 +114,11 @@ class TagEmulation: ObservableObject {
// if presentmentIntent?.isValid ?? false {
switch event {
case .sessionStarted:
+#if DEBUG
let message = "sessionStarted"
mySession.alertMessage = message
logger.info("\(message)")
+#endif
break
case .readerDetected:
@@ -146,16 +148,21 @@ class TagEmulation: ObservableObject {
}
case .sessionInvalidated(reason: _):
+#if DEBUG
mySession.alertMessage = "Ending communication with card reader."
logger.info("❗️cardSession invalidation")
+#endif
/// Handle the reason for session invalidation.
await mySession.stopEmulation(status: .failure)
return
default:
+#if DEBUG
let message = "Unknown event from card reader."
mySession.alertMessage = message
logger.info("❗️\(message)")
+#endif
+ break
}
// } else {
// logger.error("❗️presentmentIntent is not valid")
diff --git a/TalerWallet1/Views/HelperViews/GradientBorder.swift b/TalerWallet1/Views/HelperViews/GradientBorder.swift
@@ -61,7 +61,7 @@ struct BorderWithNFC<Content: View>: View {
}.buttonStyle(TalerButtonStyle(type: .prominent))
VStack {
- if nfcHint {
+ if nfcHint { // QRCodeDetailView
if showQRcode {
if !minimalistic {
Text("\(nfcLogo) Tap for NFC")
@@ -81,15 +81,9 @@ struct BorderWithNFC<Content: View>: View {
nfcButton
qrButton.buttonStyle(TalerButtonStyle(type: .bordered))
}
- } else {
- if showQRcode {
- content()
- .onTapGesture(count: 2) { tagEmulation.emulateTag(talerURI) }
- hint
- } else {
- nfcButton
- qrButton.buttonStyle(TalerButtonStyle(type: .bordered))
- }
+ } else { // AboutView
+ content()
+ .onTapGesture(count: 2) { tagEmulation.emulateTag(talerURI) }
}
}.listRowSeparator(.hidden)
.onDisappear() {
diff --git a/TalerWallet1/Views/Settings/AboutView.swift b/TalerWallet1/Views/Settings/AboutView.swift
@@ -42,7 +42,7 @@ struct AboutView: View {
rotationEnabled: $rotationEnabled)
.accessibilityHidden(true) // has its own accessibilityLabel
.frame(maxWidth: .infinity, alignment: .center)
-// .onTapGesture(count: 3) { rotationEnabled.toggle() } // would suppress double-tap in BorderWithNFC
+ .onTapGesture(count: 1) { rotationEnabled.toggle() }
Group {
List {
if #available(iOS 17.7, *) {
@@ -52,7 +52,6 @@ struct AboutView: View {
}
} else {
rotatingTaler
- .onTapGesture(count: 2) { rotationEnabled.toggle() }
}
SettingsItem(name: String(localized: "Visit the taler.net website"),
id1: "web",