Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #2377 - Added ability to share multiple history items
Browse files Browse the repository at this point in the history
  • Loading branch information
ekager authored and boek committed May 22, 2019
1 parent e5f27a2 commit 851f066
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import org.mozilla.fenix.ext.share
import org.mozilla.fenix.mvi.ActionBusFactory
import org.mozilla.fenix.mvi.getAutoDisposeObservable
import org.mozilla.fenix.mvi.getManagedEmitter
import org.mozilla.fenix.utils.ItsNotBrokenSnack
import java.net.MalformedURLException
import java.net.URL
import kotlin.coroutines.CoroutineContext
Expand Down Expand Up @@ -184,7 +183,12 @@ class HistoryFragment : Fragment(), CoroutineScope, BackHandler {
val selectedHistory = (historyComponent.uiView as HistoryUIView).getSelected()
when {
selectedHistory.size == 1 -> context?.share(selectedHistory.first().url)
selectedHistory.size > 1 -> ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "2377")
selectedHistory.size > 1 -> {
val shareText = selectedHistory.joinToString("\n") {
it.url
}
requireContext().share(shareText)
}
}
true
}
Expand Down

0 comments on commit 851f066

Please sign in to comment.