From 5037f466f6de1360a0fe04ba081935128dbd0251 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Mon, 15 Apr 2024 10:11:02 -0700 Subject: [PATCH] Defer first update active buffer for conversation (#10564) This fixes when the workspace is not actually available for a `.read(cx)`. Release Notes: - Fix a panic when quoting a selection before the assistant panel has been started Co-authored-by: Conrad Irwin --- crates/assistant/src/assistant_panel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index ae789a3f92..a215fbc8fd 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -2065,7 +2065,7 @@ impl ConversationEditor { workspace: workspace.downgrade(), _subscriptions, }; - this.update_active_buffer(workspace, cx); + cx.defer(|this, cx| this.update_active_buffer(workspace, cx)); this.update_message_headers(cx); this }