commit 6abaadf3ce03cf297cedb26badc2a0a4f3a61fe8
parent 45b3c118956f9c5fab431f484f3002f63b0dd3b5
Author: Marc Stibane <marc@taler.net>
Date: Thu, 29 Oct 2026 09:57:34 +0100
feedback optional
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/TalerCommon/HelperViews/CopyShare.swift b/TalerCommon/HelperViews/CopyShare.swift
@@ -15,6 +15,7 @@ struct FeedbackButton: View {
let title: String?
let image: UIImage?
let isDisabled: Bool
+ let haptic: Bool
let action: () -> Void
@EnvironmentObject private var controller: Controller
@@ -23,10 +24,12 @@ struct FeedbackButton: View {
public init(_ title: String? = nil,
image: UIImage? = nil,
disabled: Bool = false,
+ haptic: Bool = true,
action: @escaping @MainActor () -> Void) {
self.title = title
self.image = image
self.isDisabled = disabled
+ self.haptic = haptic
self.action = action
}
@@ -52,7 +55,9 @@ struct FeedbackButton: View {
var body: some View {
Button(title ?? EMPTYSTRING) {
symLog.log(title ?? EMPTYSTRING)
- controller.hapticFeedback(.medium)
+ if haptic {
+ controller.hapticFeedback(.medium)
+ }
action()
triggerPulse()
}