Cleanup worktrees' shared state when unsharing

This commit is contained in:
Antonio Scandurra 2022-01-17 10:58:49 +01:00
parent 5415663a73
commit f51cf6b05e
4 changed files with 62 additions and 21 deletions

View file

@ -428,6 +428,11 @@ impl Project {
rpc.send(proto::UnshareProject { project_id }).await?;
this.update(&mut cx, |this, cx| {
this.collaborators.clear();
for worktree in &this.worktrees {
worktree.update(cx, |worktree, _| {
worktree.as_local_mut().unwrap().unshare();
});
}
cx.notify()
});
Ok(())