2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

For #2377: Adds share to tabs and tab collections

This commit is contained in:
Sawyer Blatz 2019-05-20 10:57:52 -07:00 committed by Jeff Boek
parent 9c2352f2c5
commit 7e7edc8b7a

View File

@ -316,7 +316,10 @@ class HomeFragment : Fragment(), CoroutineScope {
Navigation.findNavController(view!!).navigate(directions) Navigation.findNavController(view!!).navigate(directions)
} }
is TabAction.ShareTabs -> { is TabAction.ShareTabs -> {
ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "1843") val shareText = requireComponents.core.sessionManager.sessions.joinToString("\n") {
it.url
}
requireContext().share(shareText)
} }
} }
} }
@ -357,7 +360,10 @@ class HomeFragment : Fragment(), CoroutineScope {
ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "2205") ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "2205")
} }
is CollectionAction.ShareTabs -> { is CollectionAction.ShareTabs -> {
ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "1585") val shareText = action.collection.tabs.joinToString("\n") {
it.url
}
requireContext().share(shareText)
} }
is CollectionAction.RemoveTab -> { is CollectionAction.RemoveTab -> {
launch(Dispatchers.IO) { launch(Dispatchers.IO) {