Handle when a feed in a folder being copied/moved already is subscribed in target account
This commit is contained in:
parent
30c21bb125
commit
a8f090656d
|
@ -492,6 +492,18 @@ private extension SidebarOutlineDataSource {
|
|||
case .success(let destinationFolder):
|
||||
let group = DispatchGroup()
|
||||
for feed in folder.topLevelFeeds {
|
||||
if let existingFeed = destinationAccount.existingFeed(withURL: feed.url) {
|
||||
group.enter()
|
||||
destinationAccount.addFeed(existingFeed, to: destinationFolder) { result in
|
||||
group.leave()
|
||||
switch result {
|
||||
case .success:
|
||||
break
|
||||
case .failure(let error):
|
||||
NSApplication.shared.presentError(error)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
group.enter()
|
||||
destinationAccount.createFeed(url: feed.url, name: feed.editedName, container: destinationFolder) { result in
|
||||
group.leave()
|
||||
|
@ -503,11 +515,13 @@ private extension SidebarOutlineDataSource {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group.notify(queue: DispatchQueue.main) {
|
||||
completion()
|
||||
}
|
||||
case .failure(let error):
|
||||
NSApplication.shared.presentError(error)
|
||||
completion()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue