mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 04:05:20 +00:00
Add testable initializer to LocationStateManager
Allow tests to create instances with custom UserDefaults storage for isolated testing of bookmark functionality.
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user