From ef4a6b4154553badecc97925fa54574d7cb1665f Mon Sep 17 00:00:00 2001 From: mihai-adrian Date: Tue, 3 Sep 2019 18:35:58 +0300 Subject: [PATCH] For #4877: Restored logic for closing tabs when not on browserFragment Added return in function when saving collections coming from browser fragment --- .../org/mozilla/fenix/collections/CreateCollectionFragment.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt b/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt index f11d217f7..83bea3ed1 100644 --- a/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt @@ -187,11 +187,10 @@ class CreateCollectionFragment : DialogFragment() { private fun closeTabsIfNecessary(tabs: List) { // 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) } } - } }