mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 04:18:31 +00:00
Favour network over homeserver reachability when computing the offline indicator. (#4805)
For a whole host of reasons we don't support air-gapped operation anyway and as the SDK is super slow to tell us about the homeserver's reachability the indicator wasn't really working.
This commit is contained in:
@@ -246,17 +246,17 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
MXLog.info("Homeserver reachability: \(homeserverReachability)")
|
||||
|
||||
guard let self else { return }
|
||||
switch (homeserverReachability, networkReachability) {
|
||||
case (.reachable, _):
|
||||
switch (networkReachability, homeserverReachability) {
|
||||
case (.reachable, .reachable):
|
||||
flowParameters.userIndicatorController.retractIndicatorWithId(reachabilityNotificationID)
|
||||
case (.unreachable, .unreachable):
|
||||
flowParameters.userIndicatorController.submitIndicator(.init(id: reachabilityNotificationID,
|
||||
title: L10n.commonOffline,
|
||||
persistent: true))
|
||||
case (.unreachable, .reachable):
|
||||
case (.reachable, .unreachable):
|
||||
flowParameters.userIndicatorController.submitIndicator(.init(id: reachabilityNotificationID,
|
||||
title: L10n.commonServerUnreachable,
|
||||
persistent: true))
|
||||
case (.unreachable, _):
|
||||
flowParameters.userIndicatorController.submitIndicator(.init(id: reachabilityNotificationID,
|
||||
title: L10n.commonOffline,
|
||||
persistent: true))
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
Reference in New Issue
Block a user