diff --git a/Sources/ReachabilityMiddleware/ReachabilityMiddleware.swift b/Sources/ReachabilityMiddleware/ReachabilityMiddleware.swift index 8a9dc9e..26555d4 100644 --- a/Sources/ReachabilityMiddleware/ReachabilityMiddleware.swift +++ b/Sources/ReachabilityMiddleware/ReachabilityMiddleware.swift @@ -35,7 +35,7 @@ where InputActionType == ReachabilityEvent, send(event: .gotOffline, when: ![.wiredEthernet, .wifi, .cellular].contains(where: path.usesInterfaceType), - previously: \.connectivity != .none, + previously: \.connectivity != .offline, state: state), send(event: .becameExpensive, diff --git a/Sources/ReachabilityMiddleware/ReachabilityReducer.swift b/Sources/ReachabilityMiddleware/ReachabilityReducer.swift index 1db2b11..1b6b558 100644 --- a/Sources/ReachabilityMiddleware/ReachabilityReducer.swift +++ b/Sources/ReachabilityMiddleware/ReachabilityReducer.swift @@ -28,7 +28,7 @@ extension Reducer where ActionType == ReachabilityEvent, StateType == Reachabili case .gotOffline: state = .init( isMonitoring: state.isMonitoring, - connectivity: .none, + connectivity: .offline, isExpensive: state.isExpensive, isConstrained: state.isConstrained ) diff --git a/Sources/ReachabilityMiddleware/ReachabilityState.swift b/Sources/ReachabilityMiddleware/ReachabilityState.swift index ced8920..a65b721 100644 --- a/Sources/ReachabilityMiddleware/ReachabilityState.swift +++ b/Sources/ReachabilityMiddleware/ReachabilityState.swift @@ -15,7 +15,7 @@ extension ReachabilityState { public static var initial: ReachabilityState { .init( isMonitoring: false, - connectivity: .none, + connectivity: .unknown, isExpensive: true, isConstrained: true ) @@ -23,6 +23,8 @@ extension ReachabilityState { } public enum ConnectedInterface: String, Codable, Hashable { + /// Initial state, we don't know yet the state of the interface + case unknown /// cellular (3G, LTE, 5G networks) case cellular /// Wi-fi, including Personal Hotpots @@ -30,5 +32,5 @@ public enum ConnectedInterface: String, Codable, Hashable { /// Wired Ethernet case wired /// Disconnected - case none + case offline }