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

[fenix] For https://github.com/mozilla-mobile/fenix/issues/15268: Use safe navigation to addon details fragments.

This commit is contained in:
mcarare 2020-09-22 12:08:50 +03:00 committed by Mihai Adrian Carare
parent 90ef2c90bf
commit d6f5f88deb

View File

@ -7,6 +7,8 @@ package org.mozilla.fenix.addons
import androidx.navigation.NavController
import mozilla.components.feature.addons.Addon
import mozilla.components.feature.addons.ui.AddonsManagerAdapterDelegate
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.navigateSafe
/**
* View used for managing add-ons.
@ -37,7 +39,7 @@ class AddonsManagementView(
AddonsManagementFragmentDirections.actionAddonsManagementFragmentToInstalledAddonDetails(
addon
)
navController.navigate(directions)
navController.navigateSafe(R.id.addonsManagementFragment, directions)
}
private fun showDetailsFragment(addon: Addon) {
@ -45,7 +47,7 @@ class AddonsManagementView(
AddonsManagementFragmentDirections.actionAddonsManagementFragmentToAddonDetailsFragment(
addon
)
navController.navigate(directions)
navController.navigateSafe(R.id.addonsManagementFragment, directions)
}
private fun showNotYetSupportedAddonFragment(unsupportedAddons: List<Addon>) {