1
0
Fork 0

For #4877: Restored logic for closing tabs when not on browserFragment

Added return in function when saving collections coming from browser fragment
master
mihai-adrian 2019-09-03 18:35:58 +03:00 committed by Emily Kager
parent e240de7e31
commit ef4a6b4154
1 changed files with 1 additions and 2 deletions

View File

@ -187,11 +187,10 @@ class CreateCollectionFragment : DialogFragment() {
private fun closeTabsIfNecessary(tabs: List<Tab>) {
// Only close the tabs if the user is not on the BrowserFragment
if (viewModel.previousFragmentId == R.id.browserFragment) {
if (viewModel.previousFragmentId == R.id.browserFragment) { return }
val components = requireComponents
tabs.asSequence()
.mapNotNull { tab -> components.core.sessionManager.findSessionById(tab.sessionId) }
.forEach { session -> components.useCases.tabsUseCases.removeTab(session) }
}
}
}