mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-10 11:42:25 +00:00
fix(linux-rust): Clear stale tray battery on device switch (#447)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user