From 7e4de2ac166d6d662cf08161770d09fad33510ea Mon Sep 17 00:00:00 2001 From: Mikayla Date: Sat, 21 Oct 2023 03:08:25 -0700 Subject: [PATCH] Restore synchronization --- crates/call/src/call.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/call/src/call.rs b/crates/call/src/call.rs index dbd61431dc..0f34741c1c 100644 --- a/crates/call/src/call.rs +++ b/crates/call/src/call.rs @@ -289,12 +289,13 @@ impl ActiveCall { let room_id = call.room_id.clone(); let client = self.client.clone(); let user_store = self.user_store.clone(); - let join = - cx.spawn(|this, cx| async move { Room::join(room_id, client, user_store, cx).await }); + let join = self + ._join_debouncer + .spawn(cx, move |cx| Room::join(room_id, client, user_store, cx)); cx.spawn(|this, mut cx| async move { let room = join.await?; - this.update(&mut cx, |this, cx| this.set_room(Some(room.clone()), cx)) + this.update(&mut cx, |this, cx| this.set_room(room.clone(), cx)) .await?; this.update(&mut cx, |this, cx| { this.report_call_event("accept incoming", cx) @@ -332,20 +333,18 @@ impl ActiveCall { let client = self.client.clone(); let user_store = self.user_store.clone(); - let join = cx.spawn(|this, cx| async move { + let join = self._join_debouncer.spawn(cx, move |cx| async move { Room::join_channel(channel_id, client, user_store, cx).await }); - // self._join_debouncer.spawn(cx, move |cx| async move {}); - cx.spawn(move |this, mut cx| async move { let room = join.await?; - this.update(&mut cx, |this, cx| this.set_room(Some(room.clone()), cx)) + this.update(&mut cx, |this, cx| this.set_room(room.clone(), cx)) .await?; this.update(&mut cx, |this, cx| { this.report_call_event("join channel", cx) }); - Ok(Some(room)) + Ok(room) }) }