assistant2: Prevent sending messages when the button is disabled (#26722)

This PR updates the `Chat` action handler to prevent sending messages in
the states when the submit button is disabled.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-13 16:49:21 -04:00 committed by GitHub
parent 6bdd2cf7db
commit 22f1429f97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,6 +150,14 @@ impl MessageEditor {
}
fn chat(&mut self, _: &Chat, window: &mut Window, cx: &mut Context<Self>) {
if self.is_editor_empty(cx) {
return;
}
if self.thread.read(cx).is_streaming() {
return;
}
self.send_to_model(RequestKind::Chat, window, cx);
}