Don't wait for host's worktree updates if they disconnected

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-06-22 19:45:55 +02:00
parent 48ff443d10
commit 2d8ffbdfa2
2 changed files with 20 additions and 5 deletions

View file

@ -1343,6 +1343,15 @@ impl Project {
{
*sharing_has_stopped = true;
self.collaborators.clear();
for worktree in &self.worktrees {
if let Some(worktree) = worktree.upgrade(cx) {
worktree.update(cx, |worktree, _| {
if let Some(worktree) = worktree.as_remote_mut() {
worktree.disconnected_from_host();
}
});
}
}
cx.notify();
}
}