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<()>> {
|
pub fn share_screen(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||||
if self.status.is_offline() {
|
if self.status.is_offline() {
|
||||||
return Task::ready(Err(anyhow!("room 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 {
|
cx.spawn_weak(|this, mut cx| async move {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue