From 732d0980d890e3c4fa6cda520c63bab9532c4237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 23 Feb 2023 19:03:38 +0100 Subject: [PATCH] status/bluetooth: Ignore devices when turned off gnome-bluetooth clears the list of devices when the adapter goes away, but we cannot assume that that'll happen when powered down. We don't want to show a (potentially outdated) list of devices that cannot be interacted with in that case, so explicitly check for the active state when returning devices. Part-of: --- js/ui/status/bluetooth.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index ca250dd45..a5d6451ca 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -134,6 +134,10 @@ const BtClient = GObject.registerClass({ } *getDevices() { + // Ignore any lingering device references when turned off + if (!this.active) + return; + const deviceStore = this._client.get_devices(); for (let i = 0; i < deviceStore.get_n_items(); i++) {