Fix screenshare sources error handling, is_sharing_screen() == false
on error (#34250)
Release Notes: - N/A
This commit is contained in:
parent
7915b9f93f
commit
94916cd3b6
1 changed files with 10 additions and 3 deletions
|
@ -1389,10 +1389,17 @@ impl Room {
|
||||||
let sources = cx.screen_capture_sources();
|
let sources = cx.screen_capture_sources();
|
||||||
|
|
||||||
cx.spawn(async move |this, cx| {
|
cx.spawn(async move |this, cx| {
|
||||||
let sources = sources.await??;
|
let sources = sources
|
||||||
let source = sources.first().context("no display found")?;
|
.await
|
||||||
|
.map_err(|error| error.into())
|
||||||
|
.and_then(|sources| sources);
|
||||||
|
let source =
|
||||||
|
sources.and_then(|sources| sources.into_iter().next().context("no display found"));
|
||||||
|
|
||||||
let publication = participant.publish_screenshare_track(&**source, cx).await;
|
let publication = match source {
|
||||||
|
Ok(source) => participant.publish_screenshare_track(&*source, cx).await,
|
||||||
|
Err(error) => Err(error),
|
||||||
|
};
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update(cx, |this, cx| {
|
||||||
let live_kit = this
|
let live_kit = this
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue