1
0
Fork 0

For #13071 - Only return to home when session doesn't have parent session to select

master
ekager 2020-07-29 11:34:43 -04:00 committed by Jeff Boek
parent 579a69b477
commit 6b6e1956ca
1 changed files with 2 additions and 6 deletions

View File

@ -104,7 +104,6 @@ import org.mozilla.fenix.ext.hideToolbar
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.sessionsOfType
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.home.SharedViewModel
import org.mozilla.fenix.theme.ThemeManager
@ -835,14 +834,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
sessionManager.remove(session)
true
} else {
val isLastSession =
sessionManager.sessionsOfType(private = session.private).count() == 1
if (session.hasParentSession) {
sessionManager.remove(session, true)
}
// We want to return to home if this removed session was the last session of its type
// and didn't have a parent session to select.
val goToOverview = isLastSession && !session.hasParentSession
// We want to return to home if this session didn't have a parent session to select.
val goToOverview = !session.hasParentSession
!goToOverview
}
}