diff --git a/bitchat/Services/LocationStateManager.swift b/bitchat/Services/LocationStateManager.swift index a0acfaa4..c8ec79d5 100644 --- a/bitchat/Services/LocationStateManager.swift +++ b/bitchat/Services/LocationStateManager.swift @@ -72,6 +72,13 @@ final class LocationStateManager: NSObject, CLLocationManagerDelegate, Observabl initializePermissionState() } + /// Internal initializer for testing with custom storage + init(storage: UserDefaults) { + self.storage = storage + super.init() + loadPersistedState() + } + private func loadPersistedState() { // Load selected channel if let data = storage.data(forKey: selectedChannelKey),