Fixed mic's state not being updated in titlebar if user mutes a mic via command palette
This commit is contained in:
parent
62786cd508
commit
6c676121f2
1 changed files with 4 additions and 5 deletions
|
@ -1185,6 +1185,7 @@ impl Room {
|
||||||
LocalTrack::None => Err(anyhow!("microphone was not shared")),
|
LocalTrack::None => Err(anyhow!("microphone was not shared")),
|
||||||
LocalTrack::Pending { muted, .. } => {
|
LocalTrack::Pending { muted, .. } => {
|
||||||
*muted = should_mute;
|
*muted = should_mute;
|
||||||
|
cx.notify();
|
||||||
Ok(Task::Ready(Some(Ok(()))))
|
Ok(Task::Ready(Some(Ok(()))))
|
||||||
}
|
}
|
||||||
LocalTrack::Published {
|
LocalTrack::Published {
|
||||||
|
@ -1192,7 +1193,7 @@ impl Room {
|
||||||
muted,
|
muted,
|
||||||
} => {
|
} => {
|
||||||
*muted = should_mute;
|
*muted = should_mute;
|
||||||
|
cx.notify();
|
||||||
Ok(cx.background().spawn(track_publication.set_mute(*muted)))
|
Ok(cx.background().spawn(track_publication.set_mute(*muted)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1207,11 +1208,9 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_deafen(&mut self, cx: &mut ModelContext<Self>) -> Result<Task<Result<()>>> {
|
pub fn toggle_deafen(&mut self, cx: &mut ModelContext<Self>) -> Result<Task<Result<()>>> {
|
||||||
if let Some(live_kit) = &mut self.live_kit {
|
|
||||||
(*live_kit).deafened = !live_kit.deafened
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(live_kit) = self.live_kit.as_mut() {
|
if let Some(live_kit) = self.live_kit.as_mut() {
|
||||||
|
(*live_kit).deafened = !live_kit.deafened;
|
||||||
|
cx.notify();
|
||||||
let mut tasks = Vec::with_capacity(self.remote_participants.len());
|
let mut tasks = Vec::with_capacity(self.remote_participants.len());
|
||||||
let _ = Self::set_mute(live_kit, live_kit.deafened, cx)?; // todo (osiewicz): we probably want to schedule it on fg/bg?
|
let _ = Self::set_mute(live_kit, live_kit.deafened, cx)?; // todo (osiewicz): we probably want to schedule it on fg/bg?
|
||||||
for participant in self.remote_participants.values() {
|
for participant in self.remote_participants.values() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue