From e49fc9f4b1a14963d28ee1936a0e5ca677df3be3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 19 Oct 2022 10:45:51 +0200 Subject: [PATCH] Prevent `Room` from screen-sharing twice --- crates/call/src/room.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 4553772095..d3d462e54a 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -615,6 +615,8 @@ impl Room { pub fn share_screen(&mut self, cx: &mut ModelContext) -> Task> { if self.status.is_offline() { return Task::ready(Err(anyhow!("room is offline"))); + } else if self.is_screen_sharing() { + return Task::ready(Err(anyhow!("screen was already shared"))); } cx.spawn_weak(|this, mut cx| async move {