Defer first update active buffer for conversation (cherry-pick #10564) (#10566)

gcp-cherry-pick-bot[bot] , Kyle Kelley , and Conrad Irwin created

Cherry-picked 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 <conrad@zed.dev>

Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
Co-authored-by: Conrad Irwin <conrad@zed.dev>

Change summary

crates/assistant/src/assistant_panel.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

crates/assistant/src/assistant_panel.rs 🔗

@@ -2064,7 +2064,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
     }