Change FeedbinAccountDelegate to use BatchUpdate
This commit is contained in:
parent
7f9055fe78
commit
ae61d36c7d
@ -12,6 +12,7 @@ import AppKit
|
|||||||
import UIKit
|
import UIKit
|
||||||
import RSCore
|
import RSCore
|
||||||
#endif
|
#endif
|
||||||
|
import RSCore
|
||||||
import RSWeb
|
import RSWeb
|
||||||
|
|
||||||
final class FeedbinAccountDelegate: AccountDelegate {
|
final class FeedbinAccountDelegate: AccountDelegate {
|
||||||
@ -48,7 +49,7 @@ final class FeedbinAccountDelegate: AccountDelegate {
|
|||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
completion?()
|
completion?()
|
||||||
// self?.handleError(error)
|
self?.handleError(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,7 +138,9 @@ private extension FeedbinAccountDelegate {
|
|||||||
caller.retrieveTags { [weak self] result in
|
caller.retrieveTags { [weak self] result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let tags):
|
case .success(let tags):
|
||||||
self?.syncFolders(account, tags)
|
BatchUpdate.shared.perform {
|
||||||
|
self?.syncFolders(account, tags)
|
||||||
|
}
|
||||||
self?.refreshFeeds(account, completion: completion)
|
self?.refreshFeeds(account, completion: completion)
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
@ -197,8 +200,10 @@ private extension FeedbinAccountDelegate {
|
|||||||
|
|
||||||
func syncFeeds(_ account: Account, _ subscriptions: [FeedbinSubscription]?) {
|
func syncFeeds(_ account: Account, _ subscriptions: [FeedbinSubscription]?) {
|
||||||
guard let subscriptions = subscriptions else { return }
|
guard let subscriptions = subscriptions else { return }
|
||||||
subscriptions.forEach { subscription in
|
BatchUpdate.shared.perform {
|
||||||
syncFeed(account, subscription)
|
subscriptions.forEach { subscription in
|
||||||
|
syncFeed(account, subscription)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 1b0d13f7dbb7bafe7d50027b146c10dc5bd8582c
|
Subproject commit 6ab0683e6d2fb2dc09b5625a7da62459dbc0d9af
|
Loading…
x
Reference in New Issue
Block a user