[gnome-shell/gnome-3-38] status/power: Always sync after creating proxy



commit 0f971a7ad03bcac1cf7ee26127b3f30309fa87b2
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jun 28 18:31:13 2021 +0200

    status/power: Always sync after creating proxy
    
    Otherwise the menu remains in an inconsistent state in case of an
    error, until something else triggers a call to _sync() (like a
    settings change).
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4431
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1901>
    (cherry picked from commit 8430aa59da4cd884047ee827da1702a807ff1572)

 js/ui/status/power.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 76040105f5..ca85a984aa 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -40,10 +40,10 @@ class Indicator extends PanelMenu.SystemIndicator {
             (proxy, error) => {
                 if (error) {
                     log(error.message);
-                    return;
+                } else {
+                    this._proxy.connect('g-properties-changed',
+                        this._sync.bind(this));
                 }
-                this._proxy.connect('g-properties-changed',
-                    this._sync.bind(this));
                 this._sync();
             });
 


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