mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 11:29:25 +00:00
Only send one UpdateProject msg when changing project's online status
This commit is contained in:
parent
5eaa45363d
commit
b5d862abfe
1 changed files with 2 additions and 4 deletions
|
@ -808,13 +808,11 @@ impl Project {
|
|||
&self.fs
|
||||
}
|
||||
|
||||
pub fn set_online(&mut self, online: bool, cx: &mut ModelContext<Self>) {
|
||||
pub fn set_online(&mut self, online: bool, _: &mut ModelContext<Self>) {
|
||||
if let ProjectClientState::Local { online_tx, .. } = &mut self.client_state {
|
||||
let mut online_tx = online_tx.borrow_mut();
|
||||
if *online_tx != online {
|
||||
*online_tx = online;
|
||||
drop(online_tx);
|
||||
self.metadata_changed(true, cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -958,7 +956,7 @@ impl Project {
|
|||
..
|
||||
} = &self.client_state
|
||||
{
|
||||
// Broadcast worktrees only if the project is public.
|
||||
// Broadcast worktrees only if the project is online.
|
||||
let worktrees = if *online_rx.borrow() {
|
||||
self.worktrees
|
||||
.iter()
|
||||
|
|
Loading…
Reference in a new issue