2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-05 21:20:45 +00:00

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

(cherry picked from commit ee94e6fed9e6bff88b75b5f3d6f455934a9b542d)
This commit is contained in:
Alexandru2909 2023-02-24 18:39:42 +02:00 committed by mergify[bot]
parent 3e6894131f
commit f7367af3f7
2 changed files with 20 additions and 0 deletions

View File

@ -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,
),
)
}
}
}

View File

@ -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,
),
)
}
}