Commit 9177871e authored by mcarare's avatar mcarare Committed by Mihai Adrian
Browse files

For #10408: Check current destination before navigating.

parent 9fd835de
......@@ -35,6 +35,7 @@ import org.mozilla.fenix.components.TabCollectionStorage
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.ext.navigateSafe
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.shortcut.FirstTimePwaObserver
......@@ -181,6 +182,8 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
}
override fun navToTrackingProtectionPanel(session: Session) {
val navController = findNavController()
val useCase = TrackingProtectionUseCases(
sessionManager = requireComponents.core.sessionManager,
engine = requireComponents.core.engine
......@@ -194,7 +197,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
trackingProtectionEnabled = isEnabled,
gravity = getAppropriateLayoutGravity()
)
nav(R.id.browserFragment, directions)
navController.navigateSafe(R.id.browserFragment, directions)
}
}
......
......@@ -38,6 +38,7 @@ import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getRootView
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.ext.navigateSafe
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.home.SharedViewModel
import org.mozilla.fenix.settings.deletebrowsingdata.deleteAndQuit
......@@ -190,7 +191,7 @@ class DefaultBrowserToolbarController(
} else {
val directions =
BrowserFragmentDirections.actionBrowserFragmentToCreateShortcutFragment()
navController.navigate(directions)
navController.navigateSafe(R.id.browserFragment, directions)
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment