2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

Revert "Closes #811 - Clear stack after switching to private browsing" (#876)

This reverts commit 8b793cd43e.
This commit is contained in:
Emily Kager 2019-03-06 11:48:00 -08:00 committed by Sawyer Blatz
parent 8b793cd43e
commit 58b32e944b
2 changed files with 2 additions and 10 deletions

View File

@ -16,7 +16,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.navigation.NavOptions
import androidx.navigation.Navigation import androidx.navigation.Navigation
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.component_search.* import kotlinx.android.synthetic.main.component_search.*
@ -271,13 +270,10 @@ class BrowserFragment : Fragment(), BackHandler {
ToolbarMenu.Item.Share -> requireComponents.core.sessionManager ToolbarMenu.Item.Share -> requireComponents.core.sessionManager
.selectedSession?.url?.apply { requireContext().share(this) } .selectedSession?.url?.apply { requireContext().share(this) }
ToolbarMenu.Item.NewPrivateTab -> { ToolbarMenu.Item.NewPrivateTab -> {
val navBuilder = NavOptions.Builder()
val navOptions = navBuilder.setPopUpTo(R.id.homeFragment, false).build()
val directions = BrowserFragmentDirections val directions = BrowserFragmentDirections
.actionBrowserFragmentToSearchFragment(null) .actionBrowserFragmentToSearchFragment(null)
Navigation.findNavController(view!!).navigate(directions, navOptions) Navigation.findNavController(view!!).navigate(directions)
(activity as HomeActivity).browsingModeManager.mode = (activity as HomeActivity).browsingModeManager.mode = BrowsingModeManager.Mode.Private
BrowsingModeManager.Mode.Private
} }
ToolbarMenu.Item.FindInPage -> FindInPageIntegration.launch?.invoke() ToolbarMenu.Item.FindInPage -> FindInPageIntegration.launch?.invoke()
ToolbarMenu.Item.ReportIssue -> requireComponents.core.sessionManager ToolbarMenu.Item.ReportIssue -> requireComponents.core.sessionManager

View File

@ -83,7 +83,6 @@ class HomeFragment : Fragment() {
return view return view
} }
@SuppressWarnings("ComplexMethod")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
@ -164,9 +163,6 @@ class HomeFragment : Fragment() {
BrowsingModeManager.Mode.Normal -> BrowsingModeManager.Mode.Private BrowsingModeManager.Mode.Normal -> BrowsingModeManager.Mode.Private
BrowsingModeManager.Mode.Private -> BrowsingModeManager.Mode.Normal BrowsingModeManager.Mode.Private -> BrowsingModeManager.Mode.Normal
} }
Navigation.findNavController(it).apply {
popBackStack(R.id.nav_graph, false)
}
} }
} }