Make sure that FeedFinder and InitialDownloader are running on the main thread.
This commit is contained in:
parent
e42520cd9b
commit
93fbbd4cc3
|
@ -93,8 +93,6 @@ final class LocalAccountDelegate: AccountDelegate {
|
|||
return
|
||||
}
|
||||
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
|
||||
FeedFinder.find(url: url) { result in
|
||||
|
||||
switch result {
|
||||
|
@ -102,16 +100,12 @@ final class LocalAccountDelegate: AccountDelegate {
|
|||
|
||||
guard let bestFeedSpecifier = FeedSpecifier.bestFeed(in: feedSpecifiers),
|
||||
let url = URL(string: bestFeedSpecifier.urlString) else {
|
||||
DispatchQueue.main.async {
|
||||
completion(.failure(AccountError.createErrorNotFound))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if account.hasFeed(withURL: bestFeedSpecifier.urlString) {
|
||||
DispatchQueue.main.async {
|
||||
completion(.failure(AccountError.createErrorAlreadySubscribed))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -126,19 +120,13 @@ final class LocalAccountDelegate: AccountDelegate {
|
|||
feed.editedName = name
|
||||
|
||||
container.addFeed(feed)
|
||||
DispatchQueue.main.async {
|
||||
completion(.success(feed))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case .failure:
|
||||
DispatchQueue.main.async {
|
||||
completion(.failure(AccountError.createErrorNotFound))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,10 @@ class AddFeedController: AddFeedWindowControllerDelegate {
|
|||
|
||||
account.createFeed(url: url.absoluteString, name: title, container: container) { result in
|
||||
|
||||
DispatchQueue.main.async {
|
||||
self.endShowingProgress()
|
||||
}
|
||||
|
||||
BatchUpdate.shared.end()
|
||||
|
||||
switch result {
|
||||
|
|
Loading…
Reference in New Issue