mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 07:25:19 +00:00
Notes sheet: add light haptic feedback when building geohash changes (iOS only)
This commit is contained in:
@@ -1266,11 +1266,7 @@ struct ContentView: View {
|
||||
}
|
||||
.background(backgroundColor)
|
||||
.foregroundColor(textColor)
|
||||
.onChange(of: locationManager.availableChannels) { channels in
|
||||
if let building = channels.first(where: { $0.level == .building }) {
|
||||
if notesGeohash != building.geohash { notesGeohash = building.geohash }
|
||||
}
|
||||
}
|
||||
// per-sheet global onChange added below
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
@@ -1281,6 +1277,18 @@ struct ContentView: View {
|
||||
.onDisappear {
|
||||
LocationChannelManager.shared.endLiveRefresh()
|
||||
}
|
||||
.onChange(of: locationManager.availableChannels) { channels in
|
||||
if let current = channels.first(where: { $0.level == .building })?.geohash,
|
||||
notesGeohash != current {
|
||||
notesGeohash = current
|
||||
#if os(iOS)
|
||||
// Light taptic when geohash changes while the sheet is open
|
||||
let generator = UIImpactFeedbackGenerator(style: .light)
|
||||
generator.prepare()
|
||||
generator.impactOccurred()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
updateNotesCounterSubscription()
|
||||
|
||||
Reference in New Issue
Block a user