Switch to a custom HomeserverReachability instead of different publishers

This commit is contained in:
Stefan Ceriu
2026-06-24 19:14:27 +03:00
parent 3ccaa04554
commit 0bd32d24fd
15 changed files with 65 additions and 50 deletions
@@ -13,6 +13,19 @@ enum NetworkMonitorReachability {
case unreachable
}
enum HomeserverReachability {
/// The store is open and the homeserver is reachable.
case reachable
/// The homeserver can't be reached even though we're trying to sync (i.e. offline).
case unreachable
/// The client is suspended, so the store is closed and we're not trying to reach the homeserver.
case suspended
init(_ reachability: NetworkMonitorReachability) {
self = reachability == .reachable ? .reachable : .unreachable
}
}
protocol NetworkMonitorProtocol {
var reachabilityPublisher: CurrentValuePublisher<NetworkMonitorReachability, Never> { get }
}