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