From b5d862abfe80ae771e49e0231ad2a1c9d03a1f18 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 29 Jun 2022 17:58:02 -0700 Subject: [PATCH] Only send one UpdateProject msg when changing project's online status --- crates/project/src/project.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 99a5c65533..e1a7129ab0 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -808,13 +808,11 @@ impl Project { &self.fs } - pub fn set_online(&mut self, online: bool, cx: &mut ModelContext) { + pub fn set_online(&mut self, online: bool, _: &mut ModelContext) { 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()