Fix issue where new Feeds added to a folder also got left in the account container.
This commit is contained in:
parent
fb33008b36
commit
8816de4a0e
|
@ -35,7 +35,7 @@ final class FeedbinAPICaller: NSObject {
|
|||
private var transport: Transport!
|
||||
|
||||
var credentials: Credentials?
|
||||
var accountMetadata: AccountMetadata?
|
||||
weak var accountMetadata: AccountMetadata?
|
||||
|
||||
init(transport: Transport) {
|
||||
super.init()
|
||||
|
|
|
@ -375,6 +375,7 @@ final class FeedbinAccountDelegate: AccountDelegate {
|
|||
case .success(let taggingID):
|
||||
DispatchQueue.main.async {
|
||||
self?.saveFolderRelationship(for: feed, withFolderName: folder.name ?? "", id: String(taggingID))
|
||||
account.removeFeed(feed)
|
||||
folder.addFeed(feed)
|
||||
completion(.success(()))
|
||||
}
|
||||
|
|
|
@ -59,6 +59,8 @@ class AddFeedController: AddFeedWindowControllerDelegate {
|
|||
return
|
||||
}
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
|
||||
account.createFeed(url: url.absoluteString) { [weak self] result in
|
||||
|
||||
self?.endShowingProgress()
|
||||
|
@ -67,6 +69,7 @@ class AddFeedController: AddFeedWindowControllerDelegate {
|
|||
case .success(let feed):
|
||||
self?.processFeed(feed, account: account, folder: folder, url: url, title: title)
|
||||
case .failure(let error):
|
||||
BatchUpdate.shared.end()
|
||||
switch error {
|
||||
case AccountError.createErrorAlreadySubscribed:
|
||||
self?.showAlreadySubscribedError(url.absoluteString)
|
||||
|
@ -139,8 +142,10 @@ private extension AddFeedController {
|
|||
folder.addFeed(feed) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
BatchUpdate.shared.end()
|
||||
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed])
|
||||
case .failure(let error):
|
||||
BatchUpdate.shared.end()
|
||||
NSApplication.shared.presentError(error)
|
||||
}
|
||||
}
|
||||
|
@ -148,8 +153,10 @@ private extension AddFeedController {
|
|||
account.addFeed(feed) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
BatchUpdate.shared.end()
|
||||
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed])
|
||||
case .failure(let error):
|
||||
BatchUpdate.shared.end()
|
||||
NSApplication.shared.presentError(error)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue