[Pkg-mozext-commits] [greasemonkey] 06/13: Repair uninstall undo.

David Prévot taffit at moszumanska.debian.org
Thu Jul 17 20:10:00 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit b4ca7c9563b458c58583f13d47af314db1fac85e
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Wed Jul 16 16:20:16 2014 -0400

    Repair uninstall undo.
    
    Fixes #1898
---
 content/addons4-overlay.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/content/addons4-overlay.js b/content/addons4-overlay.js
index 6571c33..4dc75db 100644
--- a/content/addons4-overlay.js
+++ b/content/addons4-overlay.js
@@ -65,8 +65,14 @@ var observer = {
         break;
       case 'edit-enabled':
         var item = gListView.getListItemForID(addon.id);
+        var callback = data? item.onEnabled : item.onDisabled;
+        if (!callback) {
+          // This observer triggers in the case of an uninstall undo.  But
+          // does not need to -- and can not -- run.  Ignore this case.
+          break;
+        }
         item.userDisabled = !data;
-        data && item.onEnabled() || item.onDisabled();
+        callback.call(item);
         break;
       case 'modified':
         if (!data) break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list