Files
element-x-ios/ElementX/Sources/Other/NetworkMonitor/NetworkMonitorProtocol.swift
T
Doug 4608a63e29 Fix some isolation errors when compiling with Swift 6.4. (#6148)
* Fix some isolation errors when compiling with Swift 6.4.

* Update the Design Tokens dependency to include Sendable conformances.
2026-09-10 15:22:53 +01:00

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 { }