Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #10718 - Finish activity after removing external session
Browse files Browse the repository at this point in the history
  • Loading branch information
ekager committed May 18, 2020
1 parent 28a6b1f commit d463696
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session

private var browserInitialized: Boolean = false
private var initUIJob: Job? = null

// We need this so we don't accidentally remove all external sessions on back press
private var sessionRemoved = false
private var enteredPip = false

private val sharedViewModel: SharedViewModel by activityViewModels()
Expand Down Expand Up @@ -587,8 +584,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session

@CallSuper
override fun onBackPressed(): Boolean {
return sessionRemoved ||
findInPageIntegration.onBackPressed() ||
return findInPageIntegration.onBackPressed() ||
fullScreenFeature.onBackPressed() ||
sessionFeature.onBackPressed() ||
removeSessionIfNeeded()
Expand Down Expand Up @@ -647,8 +643,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
val sessionManager = requireComponents.core.sessionManager
if (session.source == Session.Source.ACTION_VIEW) {
sessionManager.remove(session)
sessionRemoved = true
activity?.onBackPressed()
activity?.finish()
} else {
val isLastSession =
sessionManager.sessionsOfType(private = session.private).count() == 1
Expand Down

0 comments on commit d463696

Please sign in to comment.