diff --git a/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift b/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift index 7608e0431..c55e160e2 100644 --- a/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift +++ b/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift @@ -146,17 +146,12 @@ extension NewsBlurAccountDelegate { // Sync the folders for (folderName, folderRelationships) in newsBlurFolderDict { - let newsBlurFolderFeedIDs = folderRelationships.map { String($0.feedID) } - - // Handle account-level folder - if folderName == " " { - for feed in account.topLevelWebFeeds { - if !newsBlurFolderFeedIDs.contains(feed.webFeedID) { - account.removeWebFeed(feed) - } - } + guard folderName != " " else { + continue } + let newsBlurFolderFeedIDs = folderRelationships.map { String($0.feedID) } + guard let folder = folderDict[folderName] else { return } // Move any feeds not in the folder to the account @@ -182,6 +177,17 @@ extension NewsBlurAccountDelegate { } } } + + // Handle the account level feeds + if let folderRelationships = newsBlurFolderDict[" "] { + let newsBlurFolderFeedIDs = folderRelationships.map { String($0.feedID) } + for feed in account.topLevelWebFeeds { + if !newsBlurFolderFeedIDs.contains(feed.webFeedID) { + account.removeWebFeed(feed) + } + } + } + } func clearFolderRelationship(for feed: WebFeed, withFolderName folderName: String) {