mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-04 06:34:26 +00:00
Emit the WorktreeUpdatedEntries event for all projects, not just local (#8963)
Fixes a regression introduced in https://github.com/zed-industries/zed/pull/8846 (which hasn't yet been released), in which the project panel didn't update correctly for remote projects when collaborating. Release Notes: - N/A
This commit is contained in:
parent
06035dadea
commit
6bbd09e28e
1 changed files with 16 additions and 10 deletions
|
@ -6745,24 +6745,30 @@ impl Project {
|
|||
|
||||
fn add_worktree(&mut self, worktree: &Model<Worktree>, cx: &mut ModelContext<Self>) {
|
||||
cx.observe(worktree, |_, _, cx| cx.notify()).detach();
|
||||
if worktree.read(cx).is_local() {
|
||||
cx.subscribe(worktree, |this, worktree, event, cx| match event {
|
||||
cx.subscribe(worktree, |this, worktree, event, cx| {
|
||||
let is_local = worktree.read(cx).is_local();
|
||||
match event {
|
||||
worktree::Event::UpdatedEntries(changes) => {
|
||||
this.update_local_worktree_buffers(&worktree, changes, cx);
|
||||
this.update_local_worktree_language_servers(&worktree, changes, cx);
|
||||
this.update_local_worktree_settings(&worktree, changes, cx);
|
||||
this.update_prettier_settings(&worktree, changes, cx);
|
||||
if is_local {
|
||||
this.update_local_worktree_buffers(&worktree, changes, cx);
|
||||
this.update_local_worktree_language_servers(&worktree, changes, cx);
|
||||
this.update_local_worktree_settings(&worktree, changes, cx);
|
||||
this.update_prettier_settings(&worktree, changes, cx);
|
||||
}
|
||||
|
||||
cx.emit(Event::WorktreeUpdatedEntries(
|
||||
worktree.read(cx).id(),
|
||||
changes.clone(),
|
||||
));
|
||||
}
|
||||
worktree::Event::UpdatedGitRepositories(updated_repos) => {
|
||||
this.update_local_worktree_buffers_git_repos(worktree, updated_repos, cx)
|
||||
if is_local {
|
||||
this.update_local_worktree_buffers_git_repos(worktree, updated_repos, cx)
|
||||
}
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
let push_strong_handle = {
|
||||
let worktree = worktree.read(cx);
|
||||
|
|
Loading…
Reference in a new issue