Change so that we don't try to sync if the network is unavailable. Issue #2262
This commit is contained in:
parent
8b3bd2f388
commit
e4b27a27c5
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import RSCore
|
import RSCore
|
||||||
|
import RSWeb
|
||||||
import Articles
|
import Articles
|
||||||
import ArticlesDatabase
|
import ArticlesDatabase
|
||||||
|
|
||||||
|
@ -228,6 +229,8 @@ public final class AccountManager: UnreadCountProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func refreshAll(errorHandler: @escaping (Error) -> Void, completion: (() -> Void)? = nil) {
|
public func refreshAll(errorHandler: @escaping (Error) -> Void, completion: (() -> Void)? = nil) {
|
||||||
|
guard let reachability = try? Reachability(hostname: "apple.com"), reachability.connection != .unavailable else { return }
|
||||||
|
|
||||||
let group = DispatchGroup()
|
let group = DispatchGroup()
|
||||||
|
|
||||||
activeAccounts.forEach { account in
|
activeAccounts.forEach { account in
|
||||||
|
@ -249,6 +252,8 @@ public final class AccountManager: UnreadCountProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func refreshAll(completion: (() -> Void)? = nil) {
|
public func refreshAll(completion: (() -> Void)? = nil) {
|
||||||
|
guard let reachability = try? Reachability(hostname: "apple.com"), reachability.connection != .unavailable else { return }
|
||||||
|
|
||||||
var syncErrors = [AccountSyncError]()
|
var syncErrors = [AccountSyncError]()
|
||||||
let group = DispatchGroup()
|
let group = DispatchGroup()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue