From 706227701ec284ff926115d284381ba4cc1be7fc Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 15 Aug 2023 16:14:24 -0700 Subject: [PATCH] Keep collab panel focused after deleting a channel --- crates/collab_ui/src/collab_panel.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index ce4ffc8f6b14934d9ba7f48a8f9c3fbf4dbde046..f113f12f9db754195ae640f8af8342d7f10eded6 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();