[fenix] For https://github.com/mozilla-mobile/fenix/issues/3073 'Open in Firefox Preview' no longer opens in app

Saving and restoring the custom tab session ID fixed one problem while causing another. I added code to only restore the ID if the session has a customTabConfig associated.
pull/600/head
Colin Lee 5 years ago committed by Emily Kager
parent 4e17c26bed
commit 242169b1fd

@ -576,7 +576,11 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
override fun onViewStateRestored(savedInstanceState: Bundle?) {
super.onViewStateRestored(savedInstanceState)
customTabSessionId = savedInstanceState?.getString(KEY_CUSTOM_TAB_SESSION_ID)
savedInstanceState?.getString(KEY_CUSTOM_TAB_SESSION_ID)?.let {
if (requireComponents.core.sessionManager.findSessionById(it)?.customTabConfig != null) {
customTabSessionId = it
}
}
}
override fun onStop() {

Loading…
Cancel
Save