2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

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

This commit is contained in:
Alexandru2909 2023-02-24 18:39:42 +02:00 committed by mergify[bot]
parent 2af1b953e3
commit 21f59548a5
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,
),
)
}
}