From 32712533d15504201e95ef69043a92f529d69f1c Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 26 May 2019 12:17:38 -0500 Subject: [PATCH] Fixed duplicate adds for local account folder feed adds. Issue #701 --- Frameworks/Account/Account.swift | 2 -- Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift | 1 - Frameworks/Account/LocalAccount/LocalAccountDelegate.swift | 5 ++--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index aa2f57ac1..4bb5df495 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -388,8 +388,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, feed.name = name feed.homePageURL = homePageURL - addFeed(feed) - return feed } diff --git a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift index 1e172fde2..bb9294869 100644 --- a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift @@ -377,7 +377,6 @@ 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(())) } diff --git a/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift b/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift index 1a35a1796..51e2c4879 100644 --- a/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift +++ b/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift @@ -138,11 +138,10 @@ final class LocalAccountDelegate: AccountDelegate { } func addFeed(for account: Account, to container: Container, with feed: Feed, completion: @escaping (Result) -> Void) { - if let account = container as? Account { - account.addFeed(feed) - } if let folder = container as? Folder { folder.addFeed(feed) + } else if let account = container as? Account { + account.addFeed(feed) } completion(.success(())) }