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()