Pier Angelo Vendrame pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android

Commits:

1 changed file:

Changes:

  • fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
    ... ... @@ -1213,19 +1213,22 @@ abstract class BaseBrowserFragment :
    1213 1213
         }
    
    1214 1214
     
    
    1215 1215
         private fun handleBetaHtmlTorConnect() {
    
    1216
    -        if (getCurrentTab()?.content?.url == "about:torconnect") {
    
    1216
    +        val currentTab = getCurrentTab() ?: return
    
    1217
    +        if (currentTab.content.url == "about:torconnect") {
    
    1217 1218
                 if (!requireActivity().settings().useNewBootstrap) {
    
    1218
    -                requireContext().components.useCases.tabsUseCases.removeAllTabs()
    
    1219
    +                requireContext().components.useCases.tabsUseCases.removeTab(currentTab.id)
    
    1219 1220
                     (requireActivity() as HomeActivity).navHost.navController.navigate(
    
    1220 1221
                         NavGraphDirections.actionStartupTorbootstrap(),
    
    1221 1222
                     )
    
    1222 1223
                 } else if (!requireActivity().settings().useNewBootstrapHtmlUi) {
    
    1223
    -                requireContext().components.useCases.tabsUseCases.removeAllTabs()
    
    1224
    +                requireContext().components.useCases.tabsUseCases.removeTab(currentTab.id)
    
    1224 1225
                     (requireActivity() as HomeActivity).navigateToHome()
    
    1225 1226
                 } else {
    
    1226 1227
                     // This just makes it not flash (be visible for a split second) before handleTabSelected() hides it again
    
    1227 1228
                     browserToolbarView.view.visibility = View.GONE
    
    1228 1229
                 }
    
    1230
    +        } else if (currentTab.content.url == "about:tor") {
    
    1231
    +            requireContext().components.useCases.tabsUseCases.removeTab(currentTab.id)
    
    1229 1232
             }
    
    1230 1233
         }
    
    1231 1234