mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix bug where dragging a feed onto an empty account failed. Issue #1255
This commit is contained in:
@@ -294,11 +294,16 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
||||
return coordinator.cappedIndexPath(proposedDestinationIndexPath)
|
||||
}()
|
||||
|
||||
guard let draggedNode = dataSource.itemIdentifier(for: sourceIndexPath), let destNode = dataSource.itemIdentifier(for: destIndexPath), let parentNode = destNode.parent else {
|
||||
guard let draggedNode = dataSource.itemIdentifier(for: sourceIndexPath) else {
|
||||
assertionFailure("This should never happen")
|
||||
return sourceIndexPath
|
||||
}
|
||||
|
||||
// If there is no destination node, we are dragging onto an empty Account
|
||||
guard let destNode = dataSource.itemIdentifier(for: destIndexPath), let parentNode = destNode.parent else {
|
||||
return proposedDestinationIndexPath
|
||||
}
|
||||
|
||||
// If this is a folder and isn't expanded or doesn't have any entries, let the users drop on it
|
||||
if destNode.representedObject is Folder && (destNode.numberOfChildNodes == 0 || !destNode.isExpanded) {
|
||||
let movementAdjustment = sourceIndexPath > destIndexPath ? 1 : 0
|
||||
|
||||
Reference in New Issue
Block a user