Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

git_ui: Update section header checkboxes immediately on stage/unstage all (#57148)

Xiaobo Liu8734d0190359
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 8e547921842..b58a7572ac9 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -1743,17 +1743,14 @@ impl GitPanel {
cx.spawn({
async move |this, cx| {
let result = this
- .update(cx, |this, cx| {
- let task = active_repository.update(cx, |repo, cx| {
+ .update(cx, |_this, cx| {
+ active_repository.update(cx, |repo, cx| {
if stage {
repo.stage_all(cx)
} else {
repo.unstage_all(cx)
}
- });
- this.update_counts(active_repository.read(cx));
- cx.notify();
- task
+ })
})?
.await;
@@ -1761,6 +1758,7 @@ impl GitPanel {
if let Err(err) = result {
this.show_error_toast(if stage { "add" } else { "reset" }, err, cx);
}
+ this.update_counts(active_repository.read(cx));
cx.notify()
})
}