diff --git a/bitchat/Services/LocationNotesCounter.swift b/bitchat/Services/LocationNotesCounter.swift index 5fb443a5..2e377c4a 100644 --- a/bitchat/Services/LocationNotesCounter.swift +++ b/bitchat/Services/LocationNotesCounter.swift @@ -16,10 +16,10 @@ final class LocationNotesCounter: ObservableObject { func subscribe(geohash gh: String) { let norm = gh.lowercased() - if geohash == norm { return } - // Do not clear count immediately to avoid UI flicker; keep last known - // value until initial load completes on the new subscription. - cancel() + if geohash == norm, subscriptionID != nil { return } + // Unsubscribe previous without clearing count to avoid flicker + if let sub = subscriptionID { NostrRelayManager.shared.unsubscribe(id: sub) } + subscriptionID = nil geohash = norm noteIDs.removeAll() initialLoadComplete = false