Poll snapshot after refreshing entry
This commit is contained in:
parent
b144995f27
commit
47ce8ae05c
1 changed files with 15 additions and 14 deletions
|
@ -826,7 +826,7 @@ impl LocalWorktree {
|
||||||
root_char_bag = snapshot.root_char_bag;
|
root_char_bag = snapshot.root_char_bag;
|
||||||
next_entry_id = snapshot.next_entry_id.clone();
|
next_entry_id = snapshot.next_entry_id.clone();
|
||||||
}
|
}
|
||||||
cx.spawn_weak(|this, cx| async move {
|
cx.spawn_weak(|this, mut cx| async move {
|
||||||
let entry = Entry::new(
|
let entry = Entry::new(
|
||||||
path,
|
path,
|
||||||
&fs.metadata(&abs_path)
|
&fs.metadata(&abs_path)
|
||||||
|
@ -836,10 +836,10 @@ impl LocalWorktree {
|
||||||
root_char_bag,
|
root_char_bag,
|
||||||
);
|
);
|
||||||
|
|
||||||
let (entry, snapshot, snapshots_tx) = this
|
let this = this
|
||||||
.upgrade(&cx)
|
.upgrade(&cx)
|
||||||
.ok_or_else(|| anyhow!("worktree was dropped"))?
|
.ok_or_else(|| anyhow!("worktree was dropped"))?;
|
||||||
.read_with(&cx, |this, _| {
|
let (entry, snapshot, snapshots_tx) = this.read_with(&cx, |this, _| {
|
||||||
let this = this.as_local().unwrap();
|
let this = this.as_local().unwrap();
|
||||||
let mut snapshot = this.background_snapshot.lock();
|
let mut snapshot = this.background_snapshot.lock();
|
||||||
if let Some(old_path) = old_path {
|
if let Some(old_path) = old_path {
|
||||||
|
@ -850,6 +850,7 @@ impl LocalWorktree {
|
||||||
let snapshots_tx = this.share.as_ref().map(|s| s.snapshots_tx.clone());
|
let snapshots_tx = this.share.as_ref().map(|s| s.snapshots_tx.clone());
|
||||||
(entry, snapshot.clone(), snapshots_tx)
|
(entry, snapshot.clone(), snapshots_tx)
|
||||||
});
|
});
|
||||||
|
this.update(&mut cx, |this, cx| this.poll_snapshot(cx));
|
||||||
|
|
||||||
if let Some(snapshots_tx) = snapshots_tx {
|
if let Some(snapshots_tx) = snapshots_tx {
|
||||||
snapshots_tx.send(snapshot).await.ok();
|
snapshots_tx.send(snapshot).await.ok();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue