mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
For #13028 - Add feature flag for tab history.
This commit is contained in:
parent
b7fabdd2f1
commit
272c380755
@ -33,4 +33,9 @@ object FeatureFlags {
|
||||
* Enables swipe on toolbar to switch tabs
|
||||
*/
|
||||
val swipeToSwitchTabs = Config.channel.isNightlyOrDebug
|
||||
|
||||
/**
|
||||
* Enables viewing tab history
|
||||
*/
|
||||
val tabHistory = Config.channel.isNightlyOrDebug
|
||||
}
|
||||
|
@ -766,8 +766,11 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
|
||||
}
|
||||
|
||||
override fun onBackLongPressed(): Boolean {
|
||||
findNavController().navigate(R.id.action_global_tabHistoryDialogFragment)
|
||||
return true
|
||||
if (FeatureFlags.tabHistory) {
|
||||
findNavController().navigate(R.id.action_global_tabHistoryDialogFragment)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,6 +23,7 @@ import mozilla.components.concept.engine.prompt.ShareData
|
||||
import mozilla.components.feature.session.SessionFeature
|
||||
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
|
||||
import mozilla.components.support.ktx.kotlin.isUrl
|
||||
import org.mozilla.fenix.FeatureFlags
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.NavGraphDirections
|
||||
import org.mozilla.fenix.R
|
||||
@ -172,10 +173,12 @@ class DefaultBrowserToolbarController(
|
||||
Do exhaustive when (item) {
|
||||
ToolbarMenu.Item.Back -> sessionUseCases.goBack.invoke(currentSession)
|
||||
is ToolbarMenu.Item.Forward -> {
|
||||
if (item.viewHistory) {
|
||||
if (FeatureFlags.tabHistory && item.viewHistory) {
|
||||
navController.navigate(R.id.action_global_tabHistoryDialogFragment)
|
||||
} else {
|
||||
} else if (!item.viewHistory) {
|
||||
sessionUseCases.goForward.invoke(currentSession)
|
||||
} else {
|
||||
// Do nothing if tab history feature flag is off and item.viewHistory is true
|
||||
}
|
||||
}
|
||||
is ToolbarMenu.Item.Reload -> {
|
||||
|
Loading…
Reference in New Issue
Block a user