Add status syncing to iOS

This commit is contained in:
Maurice Parker
2019-05-20 13:51:08 -05:00
parent cfe5d22f66
commit 59ea5cadec
2 changed files with 60 additions and 11 deletions

View File

@@ -150,9 +150,19 @@ public final class AccountManager: UnreadCountProvider {
activeAccounts.forEach { $0.refreshAll() }
}
public func syncArticleStatusAll() {
activeAccounts.forEach { $0.syncArticleStatus() }
public func syncArticleStatusAll(completion: (() -> Void)? = nil) {
let group = DispatchGroup()
activeAccounts.forEach {
group.enter()
$0.syncArticleStatus() {
group.leave()
}
}
group.notify(queue: DispatchQueue.main) {
completion?()
}
}
public func anyAccountHasAtLeastOneFeed() -> Bool {