Fix folder drops that sometimes defaulted to the account. Issue #1356

This commit is contained in:
Maurice Parker 2019-11-26 13:01:07 -06:00
parent 59e512a263
commit 19336dd07e
1 changed files with 8 additions and 14 deletions

View File

@ -56,24 +56,18 @@ extension MasterFeedViewController: UITableViewDropDelegate {
// Based on the drop we have to determine a node to start looking for a parent container.
let destNode: Node? = {
if destIndexPath.row == 0 {
return coordinator.rootNode.childAtIndex(destIndexPath.section)!
if isFolderDrop {
return dataSource.itemIdentifier(for: destIndexPath)
} else {
if isFolderDrop {
return dataSource.itemIdentifier(for: destIndexPath)
if destIndexPath.row == 0 {
return coordinator.rootNode.childAtIndex(destIndexPath.section)!
} else if destIndexPath.row > 0 {
return dataSource.itemIdentifier(for: IndexPath(row: destIndexPath.row - 1, section: destIndexPath.section))
} else {
if destIndexPath.row > 0 {
return dataSource.itemIdentifier(for: IndexPath(row: destIndexPath.row - 1, section: destIndexPath.section))
} else {
return nil
}
return nil
}
}
}()
// Now we start looking for the parent container