commit bd5805443447e48b38f28c34bea096b9b327ce4f
parent 58e12a58f0274671fdf2ad69bf96962a59ba569d
Author: radixrat <radixrat@protonmail.com>
Date: Tue, 20 Dec 2022 13:15:58 -0500
add haptic feedback to like action
import UIKit
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/damus/Views/EventActionBar.swift b/damus/Views/EventActionBar.swift
@@ -6,6 +6,7 @@
//
import SwiftUI
+import UIKit
enum ActionBarSheet: Identifiable {
case reply
@@ -20,6 +21,7 @@ enum ActionBarSheet: Identifiable {
struct EventActionBar: View {
let damus_state: DamusState
let event: NostrEvent
+ let generator = UIImpactFeedbackGenerator(style: .light)
@State var sheet: ActionBarSheet? = nil
@State var confirm_boost: Bool = false
@StateObject var bar: ActionBarModel
@@ -127,6 +129,8 @@ struct EventActionBar: View {
let like_ev = make_like_event(pubkey: damus_state.pubkey, privkey: privkey, liked: event)
self.bar.our_like = like_ev
+
+ generator.impactOccurred()
damus_state.pool.send(.event(like_ev))
}