1
0
Fork 0

Only close tab on back press if it has a parent tab

master
mawen7 2020-01-08 11:28:42 +01:00 committed by Emily Kager
parent 8ed14ac062
commit a2e0af3194
1 changed files with 4 additions and 2 deletions

View File

@ -568,7 +568,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
/**
* Removes the session if it was opened by an ACTION_VIEW intent
* or if it has no more history
* or if it has a parent session and no more history
*/
protected open fun removeSessionIfNeeded(): Boolean {
getSessionById()?.let { session ->
@ -578,7 +578,9 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
} else {
val isLastSession =
sessionManager.sessionsOfType(private = session.private).count() == 1
sessionManager.remove(session, session.hasParentSession)
if (session.hasParentSession) {
sessionManager.remove(session, true)
}
val goToOverview = isLastSession || !session.hasParentSession
return !goToOverview
}