Skip to content

Commit b2326df

Browse files
committed
feat(sound): auto-select first available profile if device is Off
1 parent b243d19 commit b2326df

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

subscriptions/sound/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ impl Model {
425425
if let Some(p) = self.active_profiles.get_mut(id) {
426426
if p.index == profile.index {
427427
*p = profile.clone();
428+
} else if p.index == 0 && !matches!(profile.available, Availability::No) {
429+
// If the profile is Off, auto-select the first available profile.
430+
*p = profile.clone();
431+
let index = profile.index as u32;
432+
tokio::spawn(async move {
433+
set_profile(id, index).await;
434+
});
428435
}
429436
}
430437

0 commit comments

Comments
 (0)