mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 17:12:23 +01:00
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 RSCore
|
||||
import RSWeb
|
||||
import Articles
|
||||
import ArticlesDatabase
|
||||
|
||||
@ -228,6 +229,8 @@ public final class AccountManager: UnreadCountProvider {
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
activeAccounts.forEach { account in
|
||||
@ -249,6 +252,8 @@ public final class AccountManager: UnreadCountProvider {
|
||||
}
|
||||
|
||||
public func refreshAll(completion: (() -> Void)? = nil) {
|
||||
guard let reachability = try? Reachability(hostname: "apple.com"), reachability.connection != .unavailable else { return }
|
||||
|
||||
var syncErrors = [AccountSyncError]()
|
||||
let group = DispatchGroup()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user