[gnome-shell/gnome-42] systemActions: Disable power-off if querying support fails



commit 141a330c6d9101b7e357206cc929d416ef09774a
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jul 9 14:01:17 2022 +0200

    systemActions: Disable power-off if querying support fails
    
    Treating failure as success is weird. It's also most likely wrong,
    as the most likely reason is that gnome-session isn't running.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2372>
    (cherry picked from commit 415349c8526ca4485f6bd37be7c19579acb4c8d8)

 js/misc/systemActions.js | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js
index b43f93a3de..6d0e0497cf 100644
--- a/js/misc/systemActions.js
+++ b/js/misc/systemActions.js
@@ -331,10 +331,7 @@ const SystemActions = GObject.registerClass({
 
     _updateHaveShutdown() {
         this._session.CanShutdownRemote((result, error) => {
-            if (error)
-                return;
-
-            this._canHavePowerOff = result[0];
+            this._canHavePowerOff = error ? false : result[0];
             this._updatePowerOff();
         });
     }


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