Closes #6731 - fixed BookmarkNode minus operator and deleteOperation
parent
d955eae4e2
commit
4422e3ed39
|
@ -15,5 +15,9 @@ val Context.bookmarkStorage: PlacesBookmarksStorage
|
||||||
* Removes [children] from [BookmarkNode.children] and returns the new modified [BookmarkNode].
|
* Removes [children] from [BookmarkNode.children] and returns the new modified [BookmarkNode].
|
||||||
*/
|
*/
|
||||||
operator fun BookmarkNode.minus(children: Set<BookmarkNode>): 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
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,7 +254,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
|
||||||
bookmarkInteractor.onBookmarksChanged(bookmarkTree)
|
bookmarkInteractor.onBookmarksChanged(bookmarkTree)
|
||||||
|
|
||||||
val deleteOperation: (suspend () -> Unit) = {
|
val deleteOperation: (suspend () -> Unit) = {
|
||||||
deleteSelectedBookmarks(selected)
|
deleteSelectedBookmarks(pendingBookmarksToDelete)
|
||||||
pendingBookmarkDeletionJob = null
|
pendingBookmarkDeletionJob = null
|
||||||
// Since this runs in a coroutine, we can't depend upon the fragment still being attached
|
// Since this runs in a coroutine, we can't depend upon the fragment still being attached
|
||||||
metrics?.track(Event.RemoveBookmarks)
|
metrics?.track(Event.RemoveBookmarks)
|
||||||
|
|
Loading…
Reference in New Issue