[extensions-web] js: Make sure to properly care about uninstallation



commit a72d25b8711ec6ab88029638087ac13ca54a6172
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jun 25 19:19:47 2012 -0400

    js: Make sure to properly care about uninstallation

 sweettooth/static/js/extensions.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 592b612..1091ee1 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -93,7 +93,12 @@ function($, messages, dbusProxy, extensionUtils, templates) {
 
         $elem.find('.upgrade-button').on('click', function() {
             $elem.removeClass('upgradable');
-            dbusProxy.UninstallExtension(uuid).done(function() {
+            dbusProxy.UninstallExtension(uuid).done(function(result) {
+                // If we weren't able to uninstall the extension, don't
+                // do anything more.
+                if (!result)
+                    return;
+
                 dbusProxy.InstallExtension(uuid);
             });
         });



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]