mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 08:15:24 +00:00
4608a63e29
* Fix some isolation errors when compiling with Swift 6.4. * Update the Design Tokens dependency to include Sendable conformances.
35 lines
1.0 KiB
Swift
35 lines
1.0 KiB
Swift
//
|
|
// Copyright 2025 Element Creations Ltd.
|
|
// Copyright 2023-2025 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
nonisolated enum NetworkMonitorReachability {
|
|
case reachable
|
|
case unreachable
|
|
}
|
|
|
|
nonisolated 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 }
|
|
}
|
|
|
|
// sourcery: AutoMockable
|
|
extension NetworkMonitorProtocol { }
|