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,14 +492,27 @@ private extension SidebarOutlineDataSource {
|
||||||
case .success(let destinationFolder):
|
case .success(let destinationFolder):
|
||||||
let group = DispatchGroup()
|
let group = DispatchGroup()
|
||||||
for feed in folder.topLevelFeeds {
|
for feed in folder.topLevelFeeds {
|
||||||
group.enter()
|
if let existingFeed = destinationAccount.existingFeed(withURL: feed.url) {
|
||||||
destinationAccount.createFeed(url: feed.url, name: feed.editedName, container: destinationFolder) { result in
|
group.enter()
|
||||||
group.leave()
|
destinationAccount.addFeed(existingFeed, to: destinationFolder) { result in
|
||||||
switch result {
|
group.leave()
|
||||||
case .success:
|
switch result {
|
||||||
break
|
case .success:
|
||||||
case .failure(let error):
|
break
|
||||||
NSApplication.shared.presentError(error)
|
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()
|
||||||
|
switch result {
|
||||||
|
case .success:
|
||||||
|
break
|
||||||
|
case .failure(let error):
|
||||||
|
NSApplication.shared.presentError(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -508,6 +521,7 @@ private extension SidebarOutlineDataSource {
|
||||||
}
|
}
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
NSApplication.shared.presentError(error)
|
NSApplication.shared.presentError(error)
|
||||||
|
completion()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue