From f24d36129a13fb7fd9b08f932a9cfa9957acf90c Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Wed, 15 Jan 2025 22:06:01 +1100
Subject: bar: bluetooth hook on alias

Just in case alias changes
---
 modules/bar.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'modules/bar.tsx')

diff --git a/modules/bar.tsx b/modules/bar.tsx
index 9374b51..3e75deb 100644
--- a/modules/bar.tsx
+++ b/modules/bar.tsx
@@ -319,9 +319,13 @@ const Bluetooth = () => (
                         : "No connected devices"
                 );
             };
-            bluetooth.get_devices().forEach(d => self.hook(d, "notify::connected", update));
-            self.hook(bluetooth, "device-added", (_, device) => {
+            const hookDevice = (device: AstalBluetooth.Device) => {
                 self.hook(device, "notify::connected", update);
+                self.hook(device, "notify::alias", update);
+            };
+            bluetooth.get_devices().forEach(hookDevice);
+            self.hook(bluetooth, "device-added", (_, device) => {
+                hookDevice(device);
                 update();
             });
             update();
-- 
cgit v1.2.3-freya

