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



commit eb6a1fc505c9b41fe5b48f32fd37c42079cdeba1
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 a43eeb65ef..c79ff798e9 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]