mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/2728 & https://github.com/mozilla-mobile/fenix/issues/2729: Uses view model selected tabs for collection creation (https://github.com/mozilla-mobile/fenix/pull/2748)
This commit is contained in:
parent
cea10f040e
commit
0be9adefae
@ -666,6 +666,7 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
|
||||
val selectedSet = mutableSetOf(tabs)
|
||||
viewModel?.selectedTabs = selectedSet
|
||||
viewModel?.saveCollectionStep = SaveCollectionStep.SelectCollection
|
||||
viewModel?.tabCollections = requireComponents.core.tabCollectionStorage.cachedTabCollections.reversed()
|
||||
view?.let {
|
||||
val directions = BrowserFragmentDirections.actionBrowserFragmentToCreateCollectionFragment()
|
||||
Navigation.findNavController(it).navigate(directions)
|
||||
|
@ -121,8 +121,9 @@ class CreateCollectionFragment : DialogFragment(), CoroutineScope {
|
||||
is CollectionCreationAction.SaveCollectionName -> {
|
||||
showSavedSnackbar(it.tabs.size)
|
||||
dismiss()
|
||||
|
||||
context?.let { context ->
|
||||
val sessionBundle = it.tabs.toSessionBundle(context)
|
||||
val sessionBundle = viewModel.selectedTabs.toList().toSessionBundle(context)
|
||||
launch(Dispatchers.IO) {
|
||||
requireComponents.core.tabCollectionStorage.createCollection(it.name, sessionBundle)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user