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

For #2979 - Prevent double navigation to Create Collection Fragment

This commit is contained in:
Emily Kager 2019-05-29 13:06:55 -07:00 committed by Sawyer Blatz
parent 5f42a65c2a
commit caa36c31cd

View File

@ -26,6 +26,7 @@ import androidx.navigation.NavDirections
import androidx.navigation.Navigation import androidx.navigation.Navigation
import androidx.navigation.Navigator import androidx.navigation.Navigator
import androidx.navigation.fragment.FragmentNavigator import androidx.navigation.fragment.FragmentNavigator
import androidx.navigation.fragment.NavHostFragment.findNavController
import androidx.transition.TransitionInflater import androidx.transition.TransitionInflater
import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_home.*
import kotlinx.android.synthetic.main.fragment_home.view.* import kotlinx.android.synthetic.main.fragment_home.view.*
@ -640,6 +641,8 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
selectedTabCollection: TabCollection? = null, selectedTabCollection: TabCollection? = null,
step: SaveCollectionStep = SaveCollectionStep.SelectTabs step: SaveCollectionStep = SaveCollectionStep.SelectTabs
) { ) {
if (findNavController(this).currentDestination?.id == R.id.createCollectionFragment) return
val tabs = requireComponents.core.sessionManager.sessions.filter { !it.private } val tabs = requireComponents.core.sessionManager.sessions.filter { !it.private }
.map { Tab(it.id, it.url, it.url.urlToTrimmedHost(), it.title) } .map { Tab(it.id, it.url, it.url.urlToTrimmedHost(), it.title) }