[gnome-shell] extensionPrefs: Connect to ExtensionStateChanged after building UI



commit 17fa5a2db45e66e4b0a38952cc8a0f0b791d431f
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Mon Sep 9 17:06:55 2019 +0200

    extensionPrefs: Connect to ExtensionStateChanged after building UI
    
    Since we manipulate parts of the UI (like the switch) in this signal
    handler, let's only connect it after setting up the UI.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/705

 js/extensionPrefs/main.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index 4125605b96..1a0783bdd1 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -567,6 +567,10 @@ class ExtensionRow extends Gtk.ListBoxRow {
         this._extension = extension;
         this._prefsModule = null;
 
+        this.connect('destroy', this._onDestroy.bind(this));
+
+        this._buildUI();
+
         this._extensionStateChangedId = this._app.shellProxy.connectSignal(
             'ExtensionStateChanged', (p, sender, [uuid, newState]) => {
                 if (this.uuid !== uuid)
@@ -577,10 +581,6 @@ class ExtensionRow extends Gtk.ListBoxRow {
                 this._switch.state = state;
                 this._switch.sensitive = this._canToggle();
             });
-
-        this.connect('destroy', this._onDestroy.bind(this));
-
-        this._buildUI();
     }
 
     get uuid() {


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