Revert "status/bluetooth: Bail out and hide UI when there's no adapter"

Turns out this broke showing the bluetooth menu entry for adapters which
rely on the had-devices-setup property being set while turned off. These
adapters are completely removed from the system by the firmware after
powering them off, so in that case there is no default adapter anymore,
although we still want to show the menu.

This reverts commit aaf47167b5.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2214>
This commit is contained in:
Jonas Dreßler 2022-02-24 18:57:22 +01:00 committed by Marge Bot
parent a97ca02cf9
commit 94d9264d96

View File

@ -129,20 +129,13 @@ class Indicator extends PanelMenu.SystemIndicator {
}
_sync() {
const adapterJustAppeared = !this._adapter && this._client.default_adapter;
this._adapter = this._client.default_adapter ?? null;
if (!this._adapter) {
this._item.visible = false;
this._indicator.visible = false;
return;
}
const devices = this._getDeviceInfos();
const connectedDevices = devices.filter(dev => dev.connected);
const nConnectedDevices = connectedDevices.length;
if (!adapterJustAppeared)
if (this._client.default_adapter && this._adapter)
this._setHadSetupDevices(devices.length > 0);
this._adapter = this._client.default_adapter ?? null;
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;