mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Prevent Room
from screen-sharing twice
This commit is contained in:
parent
ed6f482e68
commit
e49fc9f4b1
1 changed files with 2 additions and 0 deletions
|
@ -615,6 +615,8 @@ impl Room {
|
|||
pub fn share_screen(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue