#1257 - Prevent the syncing indicator from showing over the offline one

This commit is contained in:
Stefan Ceriu
2023-08-08 15:09:05 +03:00
committed by Stefan Ceriu
parent 59865a4b16
commit 56544d6604
2 changed files with 20 additions and 8 deletions
@@ -475,10 +475,10 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
networkMonitorObserver = ServiceLocator.shared.networkMonitor
.reachabilityPublisher
.removeDuplicates()
.sink { reachable in
MXLog.info("Reachability changed to \(reachable)")
.sink { reachability in
MXLog.info("Reachability changed to \(reachability)")
if reachable {
if reachability == .reachable {
ServiceLocator.shared.userIndicatorController.retractIndicatorWithId(reachabilityNotificationIdentifier)
} else {
ServiceLocator.shared.userIndicatorController.submitIndicator(.init(id: reachabilityNotificationIdentifier,
@@ -566,7 +566,10 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
ServiceLocator.shared.userIndicatorController.submitIndicator(.init(id: identifier, type: .toast(progress: .indeterminate), title: L10n.commonSyncing, persistent: true))
}
showLoadingIndicator()
// Prevent the syncing indicator from showing over the offline one
if ServiceLocator.shared.networkMonitor.reachabilityPublisher.value == .reachable {
showLoadingIndicator()
}
clientProxyObserver = userSession.clientProxy
.callbacks