Skip to content

Commit

Permalink
For mozilla-mobile#8652 - Allow sharing multiple bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Mar 3, 2020
1 parent e6e2dd9 commit e272010
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
} else {
inflater.inflate(R.menu.bookmarks_select_multi, menu)
}

menu.findItem(R.id.share_bookmark_multi_select)?.isVisible = mode.selectedItems.size == 1
}
}
}
Expand Down Expand Up @@ -195,10 +193,12 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
true
}
R.id.share_bookmark_multi_select -> {
val bookmark = bookmarkStore.state.mode.selectedItems.first()
val shareTabs = bookmarkStore.state.mode.selectedItems.map {
ShareData(url = it.url, title = it.title)
}
navigate(
BookmarkFragmentDirections.actionBookmarkFragmentToShareFragment(
data = arrayOf(ShareData(url = bookmark.url, title = bookmark.title))
data = shareTabs.toTypedArray()
)
)
true
Expand Down

0 comments on commit e272010

Please sign in to comment.