From f7ae284b53649486b99e31602499456d3f214ab5 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 22 Sep 2018 14:44:16 -0700 Subject: [PATCH] =?UTF-8?q?Make=20the=20On=20My=20Mac=20account=20node=20t?= =?UTF-8?q?he=20drop=20target=20when=20the=20drop=20target=20is=20otherwis?= =?UTF-8?q?e=20invalid=20=E2=80=94=C2=A0when=20dropping=20nonlocal=20feeds?= =?UTF-8?q?=20(URLs,=20etc.=20from=20outside).=20This=20way=20you=20don?= =?UTF-8?q?=E2=80=99t=20have=20to=20be=20too=20precise=20=E2=80=94=C2=A0yo?= =?UTF-8?q?u=20can=20drag=20anywhere=20into=20the=20sidebar=20to=20add=20a?= =?UTF-8?q?=20feed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainWindow/Sidebar/SidebarOutlineDataSource.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NetNewsWire/MainWindow/Sidebar/SidebarOutlineDataSource.swift b/NetNewsWire/MainWindow/Sidebar/SidebarOutlineDataSource.swift index fbf2bec4f..783a032a9 100644 --- a/NetNewsWire/MainWindow/Sidebar/SidebarOutlineDataSource.swift +++ b/NetNewsWire/MainWindow/Sidebar/SidebarOutlineDataSource.swift @@ -195,10 +195,14 @@ private extension SidebarOutlineDataSource { } 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) { return node } guard let parentNode = node.parent else { + if let onMyMacAccountNode = treeController.nodeInTreeRepresentingObject(AccountManager.shared.localAccount) { + return onMyMacAccountNode + } return nil } return ancestorThatCanAcceptNonLocalFeed(parentNode) @@ -208,7 +212,7 @@ private extension SidebarOutlineDataSource { guard nodeIsDropTarget(parentNode), index == NSOutlineViewDropOnItemIndex else { return false } - + // Show the add-feed sheet. let folder = parentNode.representedObject as? Folder appDelegate.addFeed(draggedFeed.url, name: nil, folder: folder)