[fenix] For https://github.com/mozilla-mobile/fenix/issues/10162: Set switch back to prev state when failed to enable/disable addon (https://github.com/mozilla-mobile/fenix/pull/10164)

pull/600/head
Simon Chae 4 years ago committed by GitHub
parent 2d00592f58
commit f765736b27

@ -116,6 +116,7 @@ class InstalledAddonDetailsFragment : Fragment() {
runIfFragmentIsAttached {
switch.isClickable = true
view.remove_add_on.isEnabled = true
switch.setState(addon.isEnabled())
showSnackBar(
view,
getString(
@ -149,6 +150,7 @@ class InstalledAddonDetailsFragment : Fragment() {
runIfFragmentIsAttached {
switch.isClickable = true
view.remove_add_on.isEnabled = true
switch.setState(addon.isEnabled())
showSnackBar(
view,
getString(
@ -230,6 +232,7 @@ class InstalledAddonDetailsFragment : Fragment() {
}
},
onError = {
switch.isChecked = addon.isAllowedInPrivateBrowsing()
runIfFragmentIsAttached {
switch.isClickable = true
view.remove_add_on.isEnabled = true

Loading…
Cancel
Save