Add missing story fetching handler

This commit is contained in:
Anh Do 2020-03-13 21:28:59 -04:00
parent 299619703c
commit bf1a732e8f
No known key found for this signature in database
GPG Key ID: 451E3092F917B62D
1 changed files with 10 additions and 3 deletions

View File

@ -232,14 +232,13 @@ extension NewsBlurAccountDelegate {
caller.retrieveFeeds { result in
switch result {
case .success((let feeds, let folders)):
self.refreshProgress.completeTask()
BatchUpdate.shared.perform {
self.syncFolders(account, folders)
self.syncFeeds(account, feeds)
self.syncFeedFolderRelationship(account, folders)
}
self.refreshProgress.completeTask()
completion(.success(()))
case .failure(let error):
completion(.failure(error))
@ -451,7 +450,15 @@ extension NewsBlurAccountDelegate {
return
}
self.refreshUnreadStories(for: account, hashes: Array(hashes[numberOfStories...]), updateFetchDate: updateFetchDate, completion: completion)
self.refreshUnreadStories(for: account, hashes: Array(hashes[numberOfStories...]), updateFetchDate: updateFetchDate) { result in
os_log(.debug, log: self.log, "Done refreshing stories.")
switch result {
case .success:
completion(.success(()))
case .failure(let error):
completion(.failure(error))
}
}
}
case .failure(let error):
completion(.failure(error))