From 58eb83b73a2726848c58f3be28cb1fb3dfa5e90f Mon Sep 17 00:00:00 2001 From: jack Date: Sat, 13 Sep 2025 12:56:41 +0200 Subject: [PATCH] Notes sheet: add light haptic feedback when building geohash changes (iOS only) --- bitchat/Views/ContentView.swift | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bitchat/Views/ContentView.swift b/bitchat/Views/ContentView.swift index 10d0b4a7..0c7d03f8 100644 --- a/bitchat/Views/ContentView.swift +++ b/bitchat/Views/ContentView.swift @@ -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()