mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Switch to a custom HomeserverReachability instead of different publishers
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user