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.

Keep collab panel focused after deleting a channel

Max Brunsfeld706227701ec2
diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs
index ce4ffc8f6b1..f113f12f9db 100644
--- a/crates/collab_ui/src/collab_panel.rs
+++ b/crates/collab_ui/src/collab_panel.rs
@@ -2167,7 +2167,7 @@ impl CollabPanel {
let mut answer =
cx.prompt(PromptLevel::Warning, &prompt_message, &["Remove", "Cancel"]);
let window = cx.window();
- cx.spawn(|_, mut cx| async move {
+ cx.spawn(|this, mut cx| async move {
if answer.next().await == Some(0) {
if let Err(e) = channel_store
.update(&mut cx, |channels, _| channels.remove_channel(channel_id))
@@ -2180,6 +2180,7 @@ impl CollabPanel {
&mut cx,
);
}
+ this.update(&mut cx, |_, cx| cx.focus_self()).ok();
}
})
.detach();