Skip to content

Commit

Permalink
For mozilla-mobile#11625 - Fixes tab tray staying open when opening f…
Browse files Browse the repository at this point in the history
…rom another app
  • Loading branch information
boek committed Jun 18, 2020
1 parent 5f1c944 commit 5bc2310
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import org.mozilla.fenix.settings.search.EditCustomSearchEngineFragmentDirection
import org.mozilla.fenix.share.AddNewDeviceFragmentDirections
import org.mozilla.fenix.sync.SyncedTabsFragmentDirections
import org.mozilla.fenix.tabtray.FenixTabsAdapter
import org.mozilla.fenix.tabtray.TabTrayDialogFragment
import org.mozilla.fenix.theme.DefaultThemeManager
import org.mozilla.fenix.theme.ThemeManager
import org.mozilla.fenix.utils.BrowsersCache
Expand Down Expand Up @@ -216,8 +217,18 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
intent ?: return

val intentProcessors = listOf(CrashReporterIntentProcessor()) + externalSourceIntentProcessors
intentProcessors.any { it.process(intent, navHost.navController, this.intent) }
val intentHandled = intentProcessors.any {it.process(intent, navHost.navController, this.intent) }
browsingModeManager.mode = getModeFromIntentOrLastKnown(intent)

if (intentHandled) {
supportFragmentManager
.primaryNavigationFragment
?.childFragmentManager
?.fragments
?.lastOrNull()
?.let { it as? TabTrayDialogFragment }
?.also { it.dismissAllowingStateLoss() }
}
}

/**
Expand Down

0 comments on commit 5bc2310

Please sign in to comment.