diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index 4a53ee32f..5972c28d0 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -675,6 +675,12 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, postChildrenDidChangeNotification() } + func addFeedIfNotInAnyFolder(_ feed: Feed) { + if !flattenedFeeds().contains(feed) { + addFeed(feed) + } + } + func deleteFolder(_ folder: Folder) { folders?.remove(folder) structureDidChange() diff --git a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift index 0a9b223d5..7520d0642 100644 --- a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift @@ -377,6 +377,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(())) } @@ -389,7 +390,7 @@ final class FeedbinAccountDelegate: AccountDelegate { } } else { if let account = container as? Account { - account.addFeed(feed) + account.addFeedIfNotInAnyFolder(feed) } DispatchQueue.main.async { completion(.success(())) @@ -406,6 +407,7 @@ final class FeedbinAccountDelegate: AccountDelegate { case .success: DispatchQueue.main.async { folder.removeFeed(feed) + account.addFeedIfNotInAnyFolder(feed) completion(.success(())) } case .failure(let error):