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
|
&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 {
|
if let ProjectClientState::Local { online_tx, .. } = &mut self.client_state {
|
||||||
let mut online_tx = online_tx.borrow_mut();
|
let mut online_tx = online_tx.borrow_mut();
|
||||||
if *online_tx != online {
|
if *online_tx != online {
|
||||||
*online_tx = online;
|
*online_tx = online;
|
||||||
drop(online_tx);
|
|
||||||
self.metadata_changed(true, cx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -958,7 +956,7 @@ impl Project {
|
||||||
..
|
..
|
||||||
} = &self.client_state
|
} = &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() {
|
let worktrees = if *online_rx.borrow() {
|
||||||
self.worktrees
|
self.worktrees
|
||||||
.iter()
|
.iter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue