Bug 1818774 - Navigate to search dialog when interacting with homescreen private browsing button

(cherry picked from commit ee94e6fed9e6bff88b75b5f3d6f455934a9b542d)
pull/600/head
Alexandru2909 1 year ago committed by mergify[bot]
parent 3e6894131f
commit f7367af3f7

@ -41,6 +41,7 @@ import org.mozilla.fenix.GleanMetrics.TopSites
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserAnimator
import org.mozilla.fenix.browser.BrowserFragmentDirections
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.collections.SaveCollectionStep
import org.mozilla.fenix.components.AppStore
@ -627,6 +628,14 @@ class DefaultSessionControlController(
appStore.dispatch(
AppAction.ModeChange(Mode.fromBrowsingMode(newMode)),
)
if (navController.currentDestination?.id == R.id.searchDialogFragment) {
navController.navigate(
BrowserFragmentDirections.actionGlobalSearchDialog(
sessionId = null,
),
)
}
}
}

@ -59,6 +59,7 @@ import org.mozilla.fenix.GleanMetrics.RecentTabs
import org.mozilla.fenix.GleanMetrics.TopSites
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserFragmentDirections
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.components.Analytics
import org.mozilla.fenix.components.AppStore
@ -1099,6 +1100,11 @@ class DefaultSessionControlControllerTest {
verify {
settings.incrementNumTimesPrivateModeOpened()
AppAction.ModeChange(Mode.fromBrowsingMode(newMode))
navController.navigate(
BrowserFragmentDirections.actionGlobalSearchDialog(
sessionId = null,
),
)
}
}
@ -1129,6 +1135,11 @@ class DefaultSessionControlControllerTest {
appStore.dispatch(
AppAction.ModeChange(Mode.fromBrowsingMode(newMode)),
)
navController.navigate(
BrowserFragmentDirections.actionGlobalSearchDialog(
sessionId = null,
),
)
}
}

Loading…
Cancel
Save