Make sure completion handler is called when there are no active accounts. Issue #1727
This commit is contained in:
parent
c6beb3c9dd
commit
b53cbfcf2c
@ -272,6 +272,11 @@ public final class AccountManager: UnreadCountProvider {
|
|||||||
var allFetchedArticles = Set<Article>()
|
var allFetchedArticles = Set<Article>()
|
||||||
let numberOfAccounts = activeAccounts.count
|
let numberOfAccounts = activeAccounts.count
|
||||||
var accountsReporting = 0
|
var accountsReporting = 0
|
||||||
|
|
||||||
|
guard numberOfAccounts > 0 else {
|
||||||
|
completion(.success(allFetchedArticles))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for account in activeAccounts {
|
for account in activeAccounts {
|
||||||
account.fetchArticlesAsync(fetchType) { (articleSetResult) in
|
account.fetchArticlesAsync(fetchType) { (articleSetResult) in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user