Fix feed deletion in folder triggering unexpected deletes
This commit is contained in:
parent
a9615560ae
commit
fe7cbe3bd3
|
@ -479,13 +479,22 @@ extension NewsBlurAccountDelegate {
|
||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
account.clearWebFeedMetadata(feed)
|
let feedID = feed.webFeedID
|
||||||
account.removeWebFeed(feed)
|
|
||||||
|
if folderName == nil {
|
||||||
|
account.removeWebFeed(feed)
|
||||||
|
}
|
||||||
|
|
||||||
if let folders = account.folders {
|
if let folders = account.folders {
|
||||||
for folder in folders where folderName != nil && folder.name == folderName {
|
for folder in folders where folderName != nil && folder.name == folderName {
|
||||||
folder.removeWebFeed(feed)
|
folder.removeWebFeed(feed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if account.flattenedWebFeeds().first(where: { $0.webFeedID == feedID }) == nil {
|
||||||
|
account.clearWebFeedMetadata(feed)
|
||||||
|
}
|
||||||
|
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue