composebox_typeahead: Fix checking whether messages can be sent.

Before calling `on_enter_send`, we checked if the
`compose-send-button` is disabled, but never actually
set it to disabled, rather we updated its container
(.message-send-controls) with that state.

This commit fixes that by correctly checking the button's
container for the class .disabled-message-send-controls
which is set to indicate that the user cannot send messages
at the moment.

Fixes #30620
This commit is contained in:
Kislay Verma 2024-06-29 17:37:33 +05:30 committed by Tim Abbott
parent 9fb6b4d016
commit 4bd9a8ce50
1 changed files with 1 additions and 1 deletions

View File

@ -360,7 +360,7 @@ function handle_keydown(
e.preventDefault(); e.preventDefault();
if ( if (
compose_validate.validate_message_length() && compose_validate.validate_message_length() &&
!$("#compose-send-button").prop("disabled") !$(".message-send-controls").hasClass("disabled-message-send-controls")
) { ) {
on_enter_send(); on_enter_send();
} }