Move project sharing into Room
This commit is contained in:
parent
3d467a9491
commit
b479c8c8ba
5 changed files with 210 additions and 140 deletions
|
@ -240,6 +240,25 @@ impl Room {
|
|||
})
|
||||
}
|
||||
|
||||
pub(crate) fn share_project(
|
||||
&mut self,
|
||||
project: ModelHandle<Project>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<u64>> {
|
||||
let request = self
|
||||
.client
|
||||
.request(proto::ShareProject { room_id: self.id() });
|
||||
cx.spawn_weak(|_, mut cx| async move {
|
||||
let response = request.await?;
|
||||
project
|
||||
.update(&mut cx, |project, cx| {
|
||||
project.shared(response.project_id, cx)
|
||||
})
|
||||
.await?;
|
||||
Ok(response.project_id)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn set_location(
|
||||
&mut self,
|
||||
project: Option<&ModelHandle<Project>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue