guest promotion (#3969)

Release Notes:

- Adds the ability to promote read-only guests to read-write
participants in calls
This commit is contained in:
Conrad Irwin 2024-01-09 22:21:13 -07:00 committed by GitHub
commit 5d3f5611e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 579 additions and 163 deletions

View file

@ -2,7 +2,7 @@ use crate::{Toast, Workspace};
use collections::HashMap;
use gpui::{
AnyView, AppContext, AsyncWindowContext, DismissEvent, Entity, EntityId, EventEmitter, Render,
View, ViewContext, VisualContext,
Task, View, ViewContext, VisualContext, WindowContext,
};
use std::{any::TypeId, ops::DerefMut};
@ -292,3 +292,18 @@ where
}
}
}
pub trait NotifyTaskExt {
fn detach_and_notify_err(self, cx: &mut WindowContext);
}
impl<R, E> NotifyTaskExt for Task<Result<R, E>>
where
E: std::fmt::Debug + 'static,
R: 'static,
{
fn detach_and_notify_err(self, cx: &mut WindowContext) {
cx.spawn(|mut cx| async move { self.await.notify_async_err(&mut cx) })
.detach();
}
}