1
0
Fork 0

Closes #6731 - fixed BookmarkNode minus operator and deleteOperation

master
cesar 2019-11-23 17:58:16 -03:00 committed by Emily Kager
parent d955eae4e2
commit 4422e3ed39
2 changed files with 6 additions and 2 deletions

View File

@ -15,5 +15,9 @@ val Context.bookmarkStorage: PlacesBookmarksStorage
* Removes [children] from [BookmarkNode.children] and returns the new modified [BookmarkNode].
*/
operator fun BookmarkNode.minus(children: Set<BookmarkNode>): BookmarkNode {
return this.copy(children = this.children?.filter { it !in children })
return this.copy(children = this.children?.filter { filtered ->
children.none {
it.guid == filtered.guid
}
})
}

View File

@ -254,7 +254,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
bookmarkInteractor.onBookmarksChanged(bookmarkTree)
val deleteOperation: (suspend () -> Unit) = {
deleteSelectedBookmarks(selected)
deleteSelectedBookmarks(pendingBookmarksToDelete)
pendingBookmarkDeletionJob = null
// Since this runs in a coroutine, we can't depend upon the fragment still being attached
metrics?.track(Event.RemoveBookmarks)