mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 10:11:00 +00:00
Haptic feedback when refreshing timeline
This commit is contained in:
parent
5bc262da33
commit
789adc8b22
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,8 @@ public struct TimelineView: View {
|
|||
@StateObject private var viewModel = TimelineViewModel()
|
||||
@Binding var timeline: TimelineFilter
|
||||
|
||||
private let feedbackGenerator = UIImpactFeedbackGenerator()
|
||||
|
||||
public init(timeline: Binding<TimelineFilter>) {
|
||||
_timeline = timeline
|
||||
}
|
||||
|
@ -46,7 +48,9 @@ public struct TimelineView: View {
|
|||
viewModel.timeline = timeline
|
||||
}
|
||||
.refreshable {
|
||||
feedbackGenerator.impactOccurred(intensity: 0.3)
|
||||
await viewModel.fetchStatuses(userIntent: true)
|
||||
feedbackGenerator.impactOccurred(intensity: 0.7)
|
||||
}
|
||||
.onChange(of: watcher.latestEvent?.id) { id in
|
||||
if let latestEvent = watcher.latestEvent {
|
||||
|
|
Loading…
Reference in a new issue