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