Skip to content

Commit

Permalink
Fix bookmark folder being able to be dragger to children folders
Browse files Browse the repository at this point in the history
  • Loading branch information
jotaemepereira committed Jul 23, 2024
1 parent b3e528d commit 9133780
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ final class BookmarkOutlineViewDataSource: NSObject, NSOutlineViewDataSource, NS
let containsDescendantOfDestination = draggedFolders.contains { draggedFolder in
let folder = BookmarkFolder(id: draggedFolder.id, title: draggedFolder.name, parentFolderUUID: draggedFolder.parentFolderUUID, children: draggedFolder.children)

guard let draggedNode = treeController.node(representing: folder) else {
guard let draggedNode = treeController.findNodeWithId(representing: folder) else {
return false
}

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Bookmarks/Model/BookmarkTreeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ final class BookmarkTreeController {
return nodeInArrayRepresentingObject(nodes: [rootNode]) { $0.representedObjectEquals(object) }
}

func findNodeInSearchMode(representing object: AnyObject) -> BookmarkNode? {
func findNodeWithId(representing object: AnyObject) -> BookmarkNode? {
return nodeInArrayRepresentingObject(nodes: [rootNode]) { $0.representedObjectHasSameId(object) }
}

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Bookmarks/View/BookmarkListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ final class BookmarkListViewController: NSViewController {
}

private func expandFoldersAndScrollUntil(_ folder: BookmarkFolder) {
guard let folderNode = treeController.findNodeInSearchMode(representing: folder) else {
guard let folderNode = treeController.findNodeWithId(representing: folder) else {
return
}

Expand Down

0 comments on commit 9133780

Please sign in to comment.