Geohash count: use the same pruned/sorted list for toolbar and peer list (visibleGeohashPeople) to ensure consistency

This commit is contained in:
jack
2025-08-22 12:51:40 +02:00
parent 16fdb7b49e
commit 4bfe9ac80d
3 changed files with 17 additions and 2 deletions
+5 -1
View File
@@ -871,8 +871,12 @@ struct ContentView: View {
// Unread icon immediately to the left of the channel badge (independent from channel button)
#if os(iOS)
let cc = channelPeopleCountAndColor()
let otherPeersCount = cc.0
var otherPeersCount = cc.0
let countColor = cc.1
// Ensure geohash count matches the actual pruned list used in the sidebar
if case .location = locationManager.selectedChannel {
otherPeersCount = viewModel.visibleGeohashPeople().count
}
#else
let peerCounts = viewModel.allPeers.reduce(into: (others: 0, mesh: 0)) { counts, peer in
guard peer.id != viewModel.meshService.myPeerID else { return }