Lazily initialize and destroy the audio handle state on call initiation and end
This commit is contained in:
parent
706227701e
commit
0524abf114
2 changed files with 29 additions and 13 deletions
|
@ -5,6 +5,7 @@ pub mod room;
|
|||
use std::sync::Arc;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use audio::Audio;
|
||||
use call_settings::CallSettings;
|
||||
use client::{
|
||||
proto, ChannelId, ClickhouseEvent, Client, TelemetrySettings, TypedEnvelope, User, UserStore,
|
||||
|
@ -309,6 +310,7 @@ impl ActiveCall {
|
|||
pub fn hang_up(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||
cx.notify();
|
||||
self.report_call_event("hang up", cx);
|
||||
Audio::end_call(cx);
|
||||
if let Some((room, _)) = self.room.take() {
|
||||
room.update(cx, |room, cx| room.leave(cx))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue