mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 22:25:20 +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)
|
.background(backgroundColor)
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
.onChange(of: locationManager.availableChannels) { channels in
|
// per-sheet global onChange added below
|
||||||
if let building = channels.first(where: { $0.level == .building }) {
|
|
||||||
if notesGeohash != building.geohash { notesGeohash = building.geohash }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
@@ -1281,6 +1277,18 @@ struct ContentView: View {
|
|||||||
.onDisappear {
|
.onDisappear {
|
||||||
LocationChannelManager.shared.endLiveRefresh()
|
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 {
|
.onAppear {
|
||||||
updateNotesCounterSubscription()
|
updateNotesCounterSubscription()
|
||||||
|
|||||||
Reference in New Issue
Block a user