From 94d9264d96d05d0796898b15f9f11db26f5599a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 24 Feb 2022 18:57:22 +0100 Subject: [PATCH] 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 aaf47167b5bb2a4ac15e2cdfdfcac71498dcd7c7. Part-of: --- js/ui/status/bluetooth.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index 39c2ab62c..187e10635 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -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;