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>
This commit is contained in:
Florian Müllner 2022-07-09 14:01:17 +02:00
parent 2a3d409114
commit 415349c852

View File

@ -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();
});
}