[extensions-web] extensions: disable extensions if it was disabled prior to upgrade



commit abdf8b6213a4f6f16fc38625adff7759ad0644f3
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sun Feb 12 12:53:20 2017 +0400

    extensions: disable extensions if it was disabled prior to upgrade
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=724076

 sweettooth/static/js/extensions.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index ced3b00..d325c98 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -121,6 +121,8 @@ define(['jquery', 'messages', 'dbus!_', 'extensionUtils', 'templates', 'paginato
                        });
 
                        $elem.find('.upgrade-button').on('click', function () {
+                               let extensionState = $elem.data('state');
+
                                function installExtension() {
                                        dbusProxy.InstallExtension(uuid).then(function (result) {
                                                if (result === 'cancelled')
@@ -134,6 +136,12 @@ define(['jquery', 'messages', 'dbus!_', 'extensionUtils', 'templates', 'paginato
                                                {
                                                        // It should always became "per user" extension if 
installed from repository.
                                                        $elem.trigger('type-changed', 
extensionUtils.ExtensionType.PER_USER);
+
+                                                       // Disable extensions if it was disabled prior to 
upgrade
+                                                       if (extensionState == 
extensionUtils.ExtensionState.DISABLED)
+                                                       {
+                                                               dbusProxy.DisableExtension(uuid);
+                                                       }
                                                }
                                        });
                                }


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