Skip to content

Commit

Permalink
Closes mozilla-mobile#26750: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mike a committed Sep 5, 2022
1 parent b737bdf commit 84eb78a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ class SessionControlView(
) {

val view: RecyclerView = containerView as RecyclerView
var isCFRDisplayed = false
// We want to limit feature recommendations to one per HomePage visit.
var featureRecommended = false
var state: AppState? = null

private val sessionControlAdapter = SessionControlAdapter(
Expand All @@ -216,23 +217,23 @@ class SessionControlView(
override fun onLayoutCompleted(state: RecyclerView.State?) {
super.onLayoutCompleted(state)

if (!isCFRDisplayed && !context.settings().showHomeOnboardingDialog) {
if (!featureRecommended && !context.settings().showHomeOnboardingDialog) {
if (context.settings().showSyncCFR) {
isCFRDisplayed = SyncCFRPresenter(
featureRecommended = SyncCFRPresenter(
context = context,
recyclerView = view,
).showSyncCFR()
}

if (context.settings().shouldShowJumpBackInCFR) {
isCFRDisplayed = JumpBackInCFRDialog(view).showIfNeeded()
featureRecommended = JumpBackInCFRDialog(view).showIfNeeded()
}

if (!context.settings().shouldShowJumpBackInCFR &&
context.settings().showWallpaperOnboarding &&
!isCFRDisplayed
!featureRecommended
) {
isCFRDisplayed =
featureRecommended =
interactor.showWallpapersOnboardingDialog(this@SessionControlView.state)
}
}
Expand Down

0 comments on commit 84eb78a

Please sign in to comment.