Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #10162: Set switch back to prev state when failed to enable/disab…
Browse files Browse the repository at this point in the history
…le addon
  • Loading branch information
psymoon committed Apr 24, 2020
1 parent e51e1c8 commit 6821764
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class InstalledAddonDetailsFragment : Fragment() {
runIfFragmentIsAttached {
switch.isClickable = true
view.remove_add_on.isEnabled = true
switch.setState(addon.isEnabled())
showSnackBar(
view,
getString(
Expand Down Expand Up @@ -149,6 +150,7 @@ class InstalledAddonDetailsFragment : Fragment() {
runIfFragmentIsAttached {
switch.isClickable = true
view.remove_add_on.isEnabled = true
switch.setState(addon.isEnabled())
showSnackBar(
view,
getString(
Expand Down Expand Up @@ -230,6 +232,7 @@ class InstalledAddonDetailsFragment : Fragment() {
}
},
onError = {
switch.isChecked = addon.isAllowedInPrivateBrowsing()
runIfFragmentIsAttached {
switch.isClickable = true
view.remove_add_on.isEnabled = true
Expand Down

0 comments on commit 6821764

Please sign in to comment.