fix(linux-rust): Clear stale tray battery on device switch (#447)

This commit is contained in:
Ryder
2026-02-09 19:19:03 -08:00
committed by GitHub
parent 7ab8bd7240
commit decf070f9f

View File

@@ -34,7 +34,17 @@ impl AirPodsDevice {
if let Some(handle) = &tray_handle {
handle
.update(|tray: &mut MyTray| tray.connected = true)
.update(|tray: &mut MyTray| {
tray.connected = true;
tray.battery_headphone = None;
tray.battery_headphone_status = None;
tray.battery_l = None;
tray.battery_l_status = None;
tray.battery_r = None;
tray.battery_r_status = None;
tray.battery_c = None;
tray.battery_c_status = None;
})
.await;
}