Make the On My Mac account node the drop target when the drop target is otherwise invalid — when dropping nonlocal feeds (URLs, etc. from outside). This way you don’t have to be too precise — you can drag anywhere into the sidebar to add a feed.
This commit is contained in:
parent
38b824afca
commit
f7ae284b53
@ -195,10 +195,14 @@ private extension SidebarOutlineDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ancestorThatCanAcceptNonLocalFeed(_ node: Node) -> Node? {
|
func ancestorThatCanAcceptNonLocalFeed(_ node: Node) -> Node? {
|
||||||
|
// Default to the On My Mac account, if needed, so we can always accept a nonlocal feed drop.
|
||||||
if nodeIsDropTarget(node) {
|
if nodeIsDropTarget(node) {
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
guard let parentNode = node.parent else {
|
guard let parentNode = node.parent else {
|
||||||
|
if let onMyMacAccountNode = treeController.nodeInTreeRepresentingObject(AccountManager.shared.localAccount) {
|
||||||
|
return onMyMacAccountNode
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return ancestorThatCanAcceptNonLocalFeed(parentNode)
|
return ancestorThatCanAcceptNonLocalFeed(parentNode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user