mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-29 08:29:22 +00:00
* Bump targets to iOS 17/macOS 14 and optimize PeerList/Nostr hot paths * Migrate all 11 AppEnvironmentModels feature models to SwiftUI @Observable * Inject AppRuntimeDependencies and decompose ChatViewModel into domain extensions * Decompose Nostr protocol/relay policies and chat coordinators * Harden strict concurrency and dead-code hygiene across core packages and app * Clear remaining iOS 17 deprecation warnings in BitchatApp and VoiceRecorder * Fix BLE redundant-link thrash, Tor -1011 bans, EOSE promotion, and duplicate startup subs * Cancel stale foreground Tor reconnect task across background cycles * Bump 2.0.0 build number to 4 * Address SwiftLint, Periphery, and Codex review findings * Preserve @Observable dependencies for group details, geohash counts, and live voice availability * Refresh inbox rows when geohash participant display names update --------- Co-authored-by: jack <jackjackbits@users.noreply.github.com>
21 lines
436 B
Swift
21 lines
436 B
Swift
import Foundation
|
|
import Observation
|
|
|
|
/// Sendable counter for Swift 6-clean `withObservationTracking` `onChange` closures.
|
|
final class ObservationCounter: @unchecked Sendable {
|
|
private let lock = NSLock()
|
|
private var storage = 0
|
|
|
|
var value: Int {
|
|
lock.lock()
|
|
defer { lock.unlock() }
|
|
return storage
|
|
}
|
|
|
|
func increment() {
|
|
lock.lock()
|
|
storage += 1
|
|
lock.unlock()
|
|
}
|
|
}
|